combobox with file names


Posted by John on August 08, 2001 1:31 PM

Hey folks-

I am trying to mimic the basic functionality of excel's "open" menu on my own.

I have a combobox which I would like to populate with all the excel files in a particular directory, but I don't know the code to do this. Any suggestions?

Thanks in advance



Posted by Ivan F Moala on August 08, 2001 8:17 PM

Place code such as this in the userform ??
assuming you are using a userform ....initialize
routine.

Dim F
Dim x

F = Dir("C:\Excelfiles\Useful\*.xls")
ComboBox1.Clear
Do While Len(F) > 0

ComboBox1.AddItem F
F = Dir()
x = x + 1
Loop