Re: check and advise please
i pasted your code into an open project and it worked fine,
to check the number of files returned i added
Debug.Print List1.ListCount
immediately before your end sub
expecting it to return the number of files in the list box one time on completion, however it actually printed to the immediate window 86 times, so is probably to do with number of folders, but the file count at the bottom was right
rgds pete
Re: check and advise please
thanks westconn1.
do you or anybody else know if there is something missing from that sub using them api because i was under the impression that these api made the search for all files a lot faster but i am having the same results if not slightly faster using the Dir() function.
thank you.
casey.
Re: check and advise please
Casey,
i presume if something was missing it would fail to work, not just go slower, how many files are you trying to return in your test, and are you getting from subdirectories as well.
i wasn't timing it when i tested, but liked it because it was very easy to get the subdirectorys as well, i thought it was fast enough returning 788 files in 86 folders
i think sometimes apis are no faster than VB, just they can do more things
rgds p.