View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
[email protected] crferguson@gmail.com is offline
external usenet poster
 
Posts: 91
Default Set fs = Application.FileSearch

On Apr 15, 11:45*am, Office_Novice
wrote:
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



" wrote:
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- Hide quoted text -


- Show quoted text -


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

Dim fs
Set fs = Application.FileSearch


Cory