J
john q public
Hi all i am trying to fill a combobox with the names of folders in 26
different directories using the following code
MyPath = "q:\orders\a\" ' Set the path.
myname = Dir(MyPath, vbDirectory) ' Retrieve the first entry.
Do While myname <> "" ' Start the loop.
' Ignore the current directory and the encompassing directory.
If myname <> "." And myname <> ".." Then
ComboBox1.AddItem myname
If (GetAttr(MyPath & myname) And vbDirectory) = vbDirectory
Then
End If
End If
myname = Dir Loop
my path canges from a,b,c,d,e,f..........z and the code i have here
does the job however it takes about 1 minute for it to run all the
loops and fill the combobox.
Is there anyway this can be done quicker?
different directories using the following code
MyPath = "q:\orders\a\" ' Set the path.
myname = Dir(MyPath, vbDirectory) ' Retrieve the first entry.
Do While myname <> "" ' Start the loop.
' Ignore the current directory and the encompassing directory.
If myname <> "." And myname <> ".." Then
ComboBox1.AddItem myname
If (GetAttr(MyPath & myname) And vbDirectory) = vbDirectory
Then
End If
End If
myname = Dir Loop
my path canges from a,b,c,d,e,f..........z and the code i have here
does the job however it takes about 1 minute for it to run all the
loops and fill the combobox.
Is there anyway this can be done quicker?