Set fs = Application.FileSearch

  • Thread starter Thread starter ucanalways
  • Start date Start date
U

ucanalways

Hello Group,

I am using

Set fs = Application.FileSearch

With fs
.......
.......
........
End With

I get "Object required" error. So, what should I dim "fs" as? Should I
need to do something like

Dim wb as workbook?
If so, then what would be
Dim fs as ?

Kevin
 
Got it.. The following does the trick.

With Application.FileSearch
.....
.......
........
End With

Kevin
 
Somthing like this maybe

Sub Find()
Dim fs As Object

Set fs = Application.FileSearch

With fs
.LookIn = "c:\my documents"
.FileType = msoFileTypeExcelWorkbooks
.Execute

End With
End Sub
 
Somthing like this maybe

Sub Find()
    Dim fs As Object

    Set fs = Application.FileSearch

    With fs
        .LookIn = "c:\my documents"
        .FileType = msoFileTypeExcelWorkbooks
        .Execute

    End With
End Sub











- Show quoted text -

It works if you just dim it and not set its type:

Dim fs
Set fs = Application.FileSearch


Cory
 

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

Back
Top