lukesb
Oct 15 2009, 07:11 AM
Hi
I am trying to list the contents of a folder in a combobox, but can't seem to find any help on this anywhere...
Can anyone help..?
Cheers
Luke
Alan_G
Oct 15 2009, 07:22 AM
Hi Luke
Have a look in the VBA help files for FileSystemObject which will do what you want.
Please post back if you have any problems using it
lukesb
Oct 15 2009, 07:34 AM
Hi Alan
Sorry to be a pain, but I get keyword not found when I search for help on that. Would you give me a hand with this..?
Cheers..!
Luke
Larry Larsen
Oct 15 2009, 07:40 AM
Hi Luke
Some thing like this:
CODE
Sub FileListDemo()
Dim objFSO As Object
Dim objFolder As Object
Dim objFile As Object
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder("C:\")
For Each objFile In objFolder.Files
Debug.Print objFile.name
Next objFile
End Sub
Alan_G
Oct 15 2009, 07:53 AM
Hi
Using Larry's code, you could build a comma seperated string to assign to the RowSource of your combo using a Value List as the row Source Type
lukesb
Oct 15 2009, 08:20 AM
Excellent, thanks loads guys...

Luke
Alan_G
Oct 15 2009, 08:31 AM
Glad we could help
schitlipz
Oct 30 2009, 03:10 PM
D'oh!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please
click here.