LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default FileSearch Problem


Hello,
I'm trying to use Application.FileSearch method to find files in
given directory, using '*' as wildcard. But the macro below stops a
line .FileName="*.xls" (error '5' - invalid parameter)
I've tried to find different types of files, but some extensions i
.FileName allways causes error (*.xls, *.xla, *.rar, *.zip), som
extensions sometimes (*.dbf, *.txt), some extensions are OK (*.doc
*.pps).
What am I doing wrong?
W'2000, XL'97

Sorry for my English.
Many thanks
Jarek

Sub ListFiles()
With Application.FileSearch
.NewSearch
.LookIn = "C:\Data\Excel"
.SearchSubFolders = False
.FileName = "*.xls"
.Execute
End With

cnt = Application.FileSearch.FoundFiles.Count
For i = 1 To cnt
MsgBox Application.FileSearch.FoundFiles.Item(i)
Next i
End Su

-----------------------------------------------
~~ Message posted from http://www.ExcelTip.com
~~View and post usenet messages directly from http://www.ExcelForum.com

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
FileSearch in a combo box michaelberrier Excel Discussion (Misc queries) 0 June 16th 06 12:21 AM
.FileSearch Randall[_3_] Excel Programming 4 November 26th 03 01:48 AM
FileSearch Problem Nigel[_4_] Excel Programming 4 October 11th 03 03:43 PM
FileSearch Code Pedro[_4_] Excel Programming 1 August 6th 03 02:27 PM
FileSearch Problem Bin[_2_] Excel Programming 6 August 2nd 03 02:04 PM


All times are GMT +1. The time now is 01:53 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"