<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel>
        <title>Songhay System Funky KB: Visual Basic for Applications</title>
        <link>http://www.songhaysystem.com/kb/subject/vba</link>
        <description>The Funky Knowledge Base at songhaysystem.com. The subject of this channel is Visual Basic for Applications.</description>
        <lastBuildDate>Sat, 12 Feb 2005 09:21:57 GMT</lastBuildDate>
        <item>
<title>Word 2003 VBA Code: Emergency Repair Routines for Schema Violations; RepairAttributeViolations()</title>
<link>http://www.songhaysystem.com/kb/number/2076071644/subject/vba</link>
<description><strong>Article Excerpt: </strong>Public Sub RepairAttributeViolations(ByVal NodeBaseName As String, _
    BadAttrBaseName As String, NewAttrBaseName As String)
    '
    'Fixes attribute-level schema violation problem
    'when schema files are updated or replaced.
    '
    Dim nodes As…</description>
<pubDate>Sat, 12 Feb 2005 09:21:57 GMT</pubDate>
<dc:creator>Bryan Wilhite</dc:creator>
</item>
<item>
<title>basIsEmailValid(); This function checks for a valid email address.</title>
<link>http://www.songhaysystem.com/kb/number/2076071641/subject/vba</link>
<description><strong>Article Excerpt: </strong>Function basIsEmailValid(ByVal EmailAddr As String) As Boolean
    'This function checks for a valid email address.
    Dim lngPosAtSymbol As Long
    Dim lngPosPeriod As Long
    Dim lngPosSpace As Long
    Dim lngLength As Long
    
    basIsEmailValid …</description>
<pubDate>Fri, 04 Feb 2005 05:05:23 GMT</pubDate>
<dc:creator>Bryan Wilhite</dc:creator>
</item>
<item>
<title>EncryptionServices; Class Module</title>
<link>http://www.songhaysystem.com/kb/number/2076071642/subject/vba</link>
<description><strong>Article Excerpt: </strong>Option Compare Database

Option Explicit

Private x1a0(9) As Long
Private cle(17) As Long
Private x1a2 As Long

Private inter As Long
Private res As Long

Private ax As Long
Private bx As Long
Private cx As Long
Private dx As Long
Private si As Long

Priv…</description>
<pubDate>Fri, 04 Feb 2005 05:09:12 GMT</pubDate>
<dc:creator>Bryan Wilhite</dc:creator>
</item>
<item>
<title>Regex Object Is Not Available by Default in VBA; Microsoft VBScript Regular Expressions 5.5 Library</title>
<link>http://www.songhaysystem.com/kb/number/2076071638/subject/vba</link>
<description><strong>Article Excerpt: </strong>&quot;If you use the objects that are available in the Microsoft VBScript Regular Expressions 5.5 library, you can compare a string against a specific pattern, replace a string pattern with another string, or retrieve only portions of a formatted string. This …</description>
<pubDate>Thu, 27 Jan 2005 00:01:44 GMT</pubDate>
<dc:creator>Bryan Wilhite</dc:creator>
</item>
<item>
<title>Code: String Handling Functions from 1999; StringServices.bas</title>
<link>http://www.songhaysystem.com/kb/number/2076071635/subject/vba</link>
<description><strong>Article Excerpt: </strong>Option Explicit
'
' rasx 05/25/1999
'

Public Function CountStr(ByVal Str As String, SubStr As String, _
    Optional StartPos = 1) As Long

    Dim lngCount
    
    If VBA.VarType(StartPos) &amp;lt;&amp;gt; vbEmpty Then _
        If VBA.VarType(StartPos) &amp;lt;&amp;gt; vbInteger…</description>
<pubDate>Thu, 20 Jan 2005 20:44:44 GMT</pubDate>
<dc:creator>Bryan Wilhite</dc:creator>
</item>
<item>
<title>Code: Scanning A Root for Files and Directories with Scripting and rasxADO</title>
<link>http://www.songhaysystem.com/kb/number/2076071446/subject/vba</link>
<description><strong>Article Excerpt: </strong>Private Sub basFavoritesScan(ByRef objADO As rasxADO.ADOServices, _
    Optional ByVal Directory = &quot;\&quot;)

    Dim objFolders As Scripting.Folders
    Dim objFolder As Scripting.Folder
    Dim objFiles As Scripting.Files
    Dim objFile As Scripting.File
  …</description>
<pubDate>Tue, 15 Jan 2002 09:10:49 GMT</pubDate>
<dc:creator>Bryan Wilhite</dc:creator>
</item>
<item>
<title>Word 2000: TogglePicturePlaceHolder()</title>
<link>http://www.songhaysystem.com/kb/number/2076071417/subject/vba</link>
<description><strong>Article Excerpt: </strong>Public Sub TogglePicturePlaceHolder()
    Dim intIndex As Integer
    
    If Application.Documents.Count = 0 Then Exit Sub

    If Application.ActiveDocument.InlineShapes.Count = 0 Then Exit Sub

    With ActiveWindow.View
        .ShowPicturePlaceHolder…</description>
<pubDate>Mon, 29 Oct 2001 02:10:38 GMT</pubDate>
<dc:creator>Bryan Wilhite</dc:creator>
</item>
<item>
<title>Word 2000: GetHTMLStyles()</title>
<link>http://www.songhaysystem.com/kb/number/2076071401/subject/vba</link>
<description><strong>Article Excerpt: </strong>Public Sub GetHTMLStyles()
    Dim objParagraph As Word.Paragraph
    Dim objStyle As Word.Style, blnHTMLStyleFound As Boolean

    'Check for Word document with Word HTML Styles.
    With Application
        If .Documents.Count = 0 Then
            Call …</description>
<pubDate>Mon, 29 Oct 2001 02:09:49 GMT</pubDate>
<dc:creator>Bryan Wilhite</dc:creator>
</item>
<item>
<title>VBA in Outlook</title>
<link>http://www.songhaysystem.com/kb/number/2076071327/subject/vba</link>
<description><strong>Article Excerpt: </strong>The code written to automate Oulook is stored in a file called VbaProject.OTM. As of this writing, the locations of this file across Windows platforms is detailed at the following location:

    http://msdn.microsoft.com
        /library/officedev/odeopg
…</description>
<pubDate>Wed, 08 Nov 2000 04:02:00 GMT</pubDate>
<dc:creator>Bryan Wilhite</dc:creator>
</item>
<item>
<title>Code: basRandomNum(); Generating a Random Number between Upper and Lower Limits</title>
<link>http://www.songhaysystem.com/kb/number/2076071292/subject/vba</link>
<description><strong>Article Excerpt: </strong>Function basRandomNum(Lower As Long, Upper As Long)

    basRandomNum = VBA.Int((Upper - Lower + 1) * VBA.Rnd + Lower)

End Function</description>
<pubDate>Tue, 15 Aug 2000 00:52:00 GMT</pubDate>
<dc:creator>Bryan Wilhite</dc:creator>
</item>
<item>
<title>Code: Sending mail from Outlook Express; basSendMail()</title>
<link>http://www.songhaysystem.com/kb/number/2076071293/subject/vba</link>
<description><strong>Article Excerpt: </strong>Public Sub basSendMail()

    Dim objMailItem As MailItem
    
    Set objMailItem = Application.CreateItem(olMailItem)
    
    With objMailItem
        .To = &quot;rasx@kintespace.com&quot;
        .Subject = &quot;Is Haley's Comet for You?&quot;
        .Body = &quot;This is t…</description>
<pubDate>Tue, 15 Aug 2000 01:07:00 GMT</pubDate>
<dc:creator>Bryan Wilhite</dc:creator>
</item>
<item>
<title>The Differences among Empty, Nothing, vbNull, vbNullChar, vbNullString and the Zero-Length String</title>
<link>http://www.songhaysystem.com/kb/number/950165041/subject/vba</link>
<description><strong>Article Excerpt: </strong>Back in the days of VB 5.0, Keith Pleas in &quot;Avoid Programming Pitfalls&quot; (currently at http://msdn.microsoft.com/library/periodic/period98/kp0398.htm) writes:

[begin quote]

To keep from being embarrassed, you should know these terms:

&quot;&quot;: A zero-length s…</description>
<pubDate>Thu, 02 Mar 2000 03:31:45 GMT</pubDate>
<dc:creator>Bryan Wilhite</dc:creator>
</item>
<item>
<title>&quot;Stupid&quot; Mod Operator Tricks</title>
<link>http://www.songhaysystem.com/kb/number/900911580/subject/vba</link>
<description><strong>Article Excerpt: </strong>Mod in Ordinal Extractions

In the same manner that sub-strings can be extracted from strings with the Left() function, the Mod operator can be used to extract digits from integer values:

    (19984 - (19984 Mod 10))/10 = 1998

The Mod operator used like…</description>
<pubDate>Tue, 11 Jan 2000 05:20:01 GMT</pubDate>
<dc:creator>Bryan Wilhite</dc:creator>
</item>
<item>
<title>Start/End of Month Functions basSOM() and basEOM()</title>
<link>http://www.songhaysystem.com/kb/number/933407838/subject/vba</link>
<description><strong>Article Excerpt: </strong>Public Function basEOM(TheDate As Date)
    
    Dim dtmNextMonth As Date
    
    dtmNextMonth = VBA.DateAdd(&quot;m&quot;, 1, TheDate)
    '
    'By subtracting all of the days out of dtmNextMonth
    'for a given date (TheDate), the last day of the previous 
   …</description>
<pubDate>Sat, 31 Jul 1999 16:00:09 GMT</pubDate>
<dc:creator>Bryan Wilhite</dc:creator>
</item>
<item>
<title>Right-Justifying Text with the Format$() Function; Building Text Files with Fixed-Width Columns</title>
<link>http://www.songhaysystem.com/kb/number/2006695784/subject/vba</link>
<description><strong>Article Excerpt: </strong>In many financial applications text files are sometimes needed for automated input of data. Some data feeds are text files containing fixed-width columns. Oftentimes these columns are right-justified with the form:

    XXX123
    X12345
    XXX234

where…</description>
<pubDate>Wed, 19 May 1999 03:16:26 GMT</pubDate>
<dc:creator>Bryan Wilhite</dc:creator>
</item>
<item>
<title>Notes on the Val() Function</title>
<link>http://www.songhaysystem.com/kb/number/-1331745693/subject/vba</link>
<description><strong>Article Excerpt: </strong>Use the Val() function if you are contemplating using LTrim$() and CDbl() on a string literal. You only want the leftmost characters from this string. You want to separate the numeric values from the non-numeric values from this string---and the numeric v…</description>
<pubDate>Wed, 19 May 1999 03:02:41 GMT</pubDate>
<dc:creator>Bryan Wilhite</dc:creator>
</item>
<item>
<title>The Importance of the Call Keyword</title>
<link>http://www.songhaysystem.com/kb/number/896215984/subject/vba</link>
<description><strong>Article Excerpt: </strong>If you have ever wondered why a VBA design-time error is generated when passing arguments wrapped in parentheses to a Sub procedure, then you have forgotten about the importance of the Call keyword.

For example,

    MySub(arg1, arg2) 'will generate an e…</description>
<pubDate>Sun, 25 Apr 1999 06:00:13 GMT</pubDate>
<dc:creator>Bryan Wilhite</dc:creator>
</item>
<item>
<title>The vbYesNoCancel Form with the VBA.MsgBox Statement</title>
<link>http://www.songhaysystem.com/kb/number/922826868/subject/vba</link>
<description><strong>Article Excerpt: </strong>'The following design should speak for itself:

    Select Case VBA.MsgBox(&quot;Yes, No or Cancel?&quot;, _
        vbQuestion + vbYesNoCancel)
        Case vbYes
            'The Yes case.
        Case vbNo
            'The No case.
        Case vbCancel
        …</description>
<pubDate>Wed, 31 Mar 1999 05:58:36 GMT</pubDate>
<dc:creator>Bryan Wilhite</dc:creator>
</item>
<item>
<title>Use of the VarType() Function with Optional Function Parameters</title>
<link>http://www.songhaysystem.com/kb/number/1131791619/subject/vba</link>
<description><strong>Article Excerpt: </strong>Since Optional function arguments are variants, the VarType() function should be used to &quot;sub-type&quot; these arguments for a non-variant data type. The sample code fragment below illustrates the form:

Public Sub OpenTextFile(FileName As String, _
        Op…</description>
<pubDate>Wed, 10 Feb 1999 02:21:46 GMT</pubDate>
<dc:creator>Bryan Wilhite</dc:creator>
</item>
<item>
<title>OLE Automation: Using Fully Qualified References for Libraries Considered &quot;Default&quot;</title>
<link>http://www.songhaysystem.com/kb/number/-589421703/subject/vba</link>
<description><strong>Article Excerpt: </strong>I have decided to use fully qualified references to OLE Automation Libraries---even those considered &quot;default&quot; like the VB, VBA and Application objects. I do this because Microsoft says it does not hurt (it may improve performance slightly) and it allows …</description>
<pubDate>Fri, 05 Feb 1999 17:59:32 GMT</pubDate>
<dc:creator>Bryan Wilhite</dc:creator>
</item>
<item>
<title>Code: Return only Numbers and Digits (Optional) from a String; basGetDigits()</title>
<link>http://www.songhaysystem.com/kb/number/901832194/subject/vba</link>
<description><strong>Article Excerpt: </strong>Public Function basGetDigits(ByVal Literal as String, _
    Optional ByVal InclDec = False) As String

    Dim lngCount As Long
    Dim strChar As String
    Dim strRet As String
    Dim strCmp As String

    If InclDec Then
        strCmp = &quot;1234567890.&quot;…</description>
<pubDate>Tue, 12 Jan 1999 05:35:05 GMT</pubDate>
<dc:creator>Bryan Wilhite</dc:creator>
</item>
<item>
<title>ByVal and ByRef; Functions and Classes</title>
<link>http://www.songhaysystem.com/kb/number/81051056/subject/vba</link>
<description><strong>Article Excerpt: </strong>When a variable is passed to a function, by default (since VB 4.0) it is passed by reference. If the variable is local to the procedure calling the function, an error will be generated if the function does not use the ByVal keyword in the argument list. H…</description>
<pubDate>Tue, 12 Jan 1999 05:34:33 GMT</pubDate>
<dc:creator>Bryan Wilhite</dc:creator>
</item>
<item>
<title>Code: Scanning A Root for Files and Directories</title>
<link>http://www.songhaysystem.com/kb/number/911637588/subject/vba</link>
<description><strong>Article Excerpt: </strong>Public Function basScan() As Boolean
    
    Dim strPath As String, strName As String
    
    On Error GoTo basScan_Err

    basScan = True    

    strPath = &quot;C:\&quot;
    
    strName = VBA.Dir(strPath, vbDirectory)
    
    Do While strName &amp;lt;&amp;gt; Empty
    …</description>
<pubDate>Tue, 01 Dec 1998 02:36:08 GMT</pubDate>
<dc:creator>Bryan Wilhite</dc:creator>
</item>
<item>
<title>Limitations of the Do Loop</title>
<link>http://www.songhaysystem.com/kb/number/362287989/subject/vba</link>
<description><strong>Article Excerpt: </strong>Using multiple conditions in the Do Loop structure with the Like operator do not always evaluate properly. In such cases, the use of Exit Do helps. For example, the following Do Loop condition is never true:

    Do Until g_str Like &quot;*PAGE*&quot; Or g_str Like…</description>
<pubDate>Thu, 29 Oct 1998 20:54:50 GMT</pubDate>
<dc:creator>Bryan Wilhite</dc:creator>
</item>
<item>
<title>Code: The &quot;Are You Sure?&quot; Message in an If...Then Structure</title>
<link>http://www.songhaysystem.com/kb/number/892576584/subject/vba</link>
<description><strong>Article Excerpt: </strong>    If VBA.MsgBox(&quot;Are you sure?&quot;, vbYesNo + _
        vbDefaultButton2 + vbQuestion) = vbNo Then
        'User is not sure.
    End If</description>
<pubDate>Thu, 29 Oct 1998 20:48:31 GMT</pubDate>
<dc:creator>Bryan Wilhite</dc:creator>
</item>
<item>
<title>Code: General Error Handling Structure for a Function</title>
<link>http://www.songhaysystem.com/kb/number/904007897/subject/vba</link>
<description><strong>Article Excerpt: </strong>Public Function basMyFunc() As Boolean

On Error Goto basMyFunc_Err

    basMyFunc = True

    'Code for function goes here.

basMyFunc_Exit:

    'Clean-up code goes here.

    Exit Function

basMyFunc_Err:
    Select Case VBA.Err
        'Case &amp;lt;Err numb…</description>
<pubDate>Thu, 29 Oct 1998 20:50:40 GMT</pubDate>
<dc:creator>Bryan Wilhite</dc:creator>
</item>
<item>
<title>Code: A Seconds Delay with DoEvents; basDelaySec()</title>
<link>http://www.songhaysystem.com/kb/number/-165293778/subject/vba</link>
<description><strong>Article Excerpt: </strong>Public Sub basDelaySec(ByVal Seconds As Long)

    Dim dtmDate as Date

    dtmDate = DateAdd(&quot;s&quot;, Seconds, Now)
    
    Do
        DoEvents
    Loop Until Now &amp;gt; dtmDate

End Sub</description>
<pubDate>Thu, 29 Oct 1998 20:39:10 GMT</pubDate>
<dc:creator>Bryan Wilhite</dc:creator>
</item>
<item>
<title>Protecting Type Conversion Functions From Null Values</title>
<link>http://www.songhaysystem.com/kb/number/899226217/subject/vba</link>
<description><strong>Article Excerpt: </strong>To avoid Run-time Error 94 (Invalid Use of Null) when using type conversion functions, &quot;protect&quot; them by concatenating &quot;default&quot; values where logically possible. Suppose that g_varReturn is a variant. We can use type conversion functions on g_varReturn wi…</description>
<pubDate>Tue, 30 Jun 1998 17:12:05 GMT</pubDate>
<dc:creator>Bryan Wilhite</dc:creator>
</item>
<item>
<title>Review of the Data Type Summary: Floating Point Numbers</title>
<link>http://www.songhaysystem.com/kb/number/-1062179649/subject/vba</link>
<description><strong>Article Excerpt: </strong>The online help for VBA has a topic called &quot;Data Type Summary.&quot; For those of us who are not computer scientists we should take note of the following with regard to floating point numbers:

The use of scientific notation in the help file topic to denote ra…</description>
<pubDate>Sat, 13 Jun 1998 06:03:15 GMT</pubDate>
<dc:creator>Bryan Wilhite</dc:creator>
</item>
<item>
<title>VBA Can't Tell What Day It Is?</title>
<link>http://www.songhaysystem.com/kb/number/183/subject/vba</link>
<description><strong>Article Excerpt: </strong>Wrong. VBA can tell what day it is. VBA has the Weekday() function.</description>
<pubDate>Tue, 19 May 1998 16:14:05 GMT</pubDate>
<dc:creator>Bryan Wilhite</dc:creator>
</item>
<item>
<title>Using the FreeFile Function</title>
<link>http://www.songhaysystem.com/kb/number/125/subject/vba</link>
<description><strong>Article Excerpt: </strong>The following code fragment demonstrates how the FreeFile function searches for a free file number when opening a file:

Dim i As Integer
    i = FreeFile
    Open &amp;lt;file&amp;gt; For Input As #i
        Do Until EOF(i)
            &amp;lt;stuff&amp;gt;
        Loop
    Close #…</description>
<pubDate>Tue, 19 May 1998 16:17:43 GMT</pubDate>
<dc:creator>Bryan Wilhite</dc:creator>
</item>
<item>
<title>Limitations of the Timer Function</title>
<link>http://www.songhaysystem.com/kb/number/893286145/subject/vba</link>
<description><strong>Article Excerpt: </strong>The Timer function resets itself at 12 midnight each day. Its value never exceeds 86,400 (24hrs/day * 60mins/hr * 60sec/min).</description>
<pubDate>Wed, 22 Apr 1998 23:41:30 GMT</pubDate>
<dc:creator>Bryan Wilhite</dc:creator>
</item>
<item>
<title>Iterating Through a 0-Based Or 1-Based &quot;Logical Group&quot; Via the Number of Items in the Group</title>
<link>http://www.songhaysystem.com/kb/number/891062485/subject/vba</link>
<description><strong>Article Excerpt: </strong>You will always have to subtract one from a zero-based group when iterating via the number of items in the group. For example, to iterate through the Fields collection of a TableDef object based on the Count property, you need to subtract 1 from the Count…</description>
<pubDate>Sat, 28 Mar 1998 07:36:00 GMT</pubDate>
<dc:creator>Bryan Wilhite</dc:creator>
</item>

    </channel>
</rss>