Quote Originally Posted by xld
How many files have you got? I could only take one tenth of a second even on the windows directory files.

ANyway, this code is 20-30% quicker than the other guy's in my tests. You need to set a reference to the Microsoft Scripting Runtime library


Dim oFSO As Scripting.FileSystemObject
Dim oFolder As Folder, oFile As File
Set oFSO = CreateObject("Scripting.FilesystemObject")
Set oFolder = oFSO.getfolder("c:\windows")
For Each oFile In oFolder.Files
ListBox1.AddItem oFile.Name
Next oFile
Can yo attach your file? How can I set a reference to the Microsoft Scripting Runtime library? Through Menu in VBE or by Code?