FileName parameter in FileSearch object

B

Bart

Hi all,

I have a macro with the following code:

Set fs = Application.FileSearch
pad$ = CurDir

With fs
.LookIn = pad$
.SearchSubFolders = False
.FileName = "*"
If .Execute() > 0 Then

etc.

But when I run this I get an Error 5 (Invalid procedure call...) when
I get to the line
..FileName = "*"

When I change the parameter in an non-existent filename, the macro
runs and tells me there is no file found (message coded in macro).
Can anybody enlighten me?
I don't see what can be wrong.

TIA!

Bart
 
W

Word Heretic

G'day Bart <[email protected]>,

read only. Your mask is already set by pad$

eg

pad$ = Curdir & "/*.doc"


Steve Hudson - Word Heretic

steve from wordheretic.com (Email replies require payment)
Without prejudice


Bart reckoned:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top