[Excel] Application.filesearch - not working for Excel 2003?!?
When I run "With Application.filesearch" (eg Copying some standard code off a vba website into a sheet a module and running it!), EVERY TIME it gets to
Code:
If .Execute > 0 Then
' my code
End If
It always comes up with a value of zero - ie it skips the code and goes to the end if.
This applies to xls and doc file extensions, I have tried changing the sort properties, I have tried changing the SearchSubFolders property to true... everything.
I even downloaded the "standard" Excel example sheet from the VBA Express site and ran that on a folder that is full of files - and still it returns NO FILES. I tdoesn't return an error, it just doesn't recognise there to be any files in the folder (even with msoFileTypeAllFiles!)
I am using Ms Office 2003, in Excel, and the computer runs (fairly) normally for a PC on Windows.
Does anyone have any idea what is going on?!?
Thank you!
Re: [Excel] Application.filesearch - not working for Excel 2003?!?
works fine for me in excel 2000
post the entire procedure
Re: [Excel] Application.filesearch - not working for Excel 2003?!?
This is an excellent example: http://www.vbaexpress.com/kb/getarticle.php?kb_id=800
Neither the procedure copied into a module, nor the download work. Any ideas?
Re: [Excel] Application.filesearch - not working for Excel 2003?!?
i pasted the code into a module and ran, works fine for me except that application.filedialog is not available in excel 2000, so i had to modify (remove) that part
i do not know why it might not work on your machine, you must put .xls or whatever file type you want to find in inputbox
Re: [Excel] Application.filesearch - not working for Excel 2003?!?
Ellie, can you show the exact code that you are using? Perhaps an sample Excel File would help in providing a faster resolution.
Sid