application.filesearch error in office 2010

D

Dave

Hi Smarts,

I have the following macro that has been working fine for ages in
Excel 2003 and now is giving me "run time error 445 Object doesn't
support this action" in Excel 2010. I need help in fixing this macro
please.

Sub all_2010_pdf()
Dim i As Long
With Application.FileSearch
.NewSearch
.SearchSubFolders = True
.Filename = "*.pdf"
.LookIn = "\c:\temp\vba"
.Execute
For i = 1 To .FoundFiles.Count
ActiveSheet.Hyperlinks.Add Anchor:=Range("A" & i), _
Address:=.FoundFiles(i), TextToDisplay:= _
Right(.FoundFiles(i), Len(.FoundFiles(i)) - _
InStrRev(.FoundFiles(i), "\"))
Next
End With
End Sub
===================================================

Thanks in advance
 
J

Jim Cone

FileSearch was removed from Excel in the 2007 version.
The VBA Dir function or the Scripting FileSystemObject can be used to replace it.
--
Jim Cone
Portland, Oregon USA
http://www.mediafire.com/PrimitiveSoftware .
(List Files add-in: lists specific files/folders with hyperlinks) .




"Dave" <[email protected]>
wrote in message
news:a98c27c9-447f-4c28-84c7-70c476263c33@o21g2000prh.googlegroups.com...
 
D

Dave

FileSearch was removed from Excel in the 2007 version.
The VBA Dir function or the Scripting FileSystemObject can be used to replace it.
--
Jim Cone
Portland, Oregon USAhttp://www.mediafire.com/PrimitiveSoftware .
(List Files add-in:  lists specific files/folders with hyperlinks)  .

"Dave" <[email protected]>
wrote in message






- Show quoted text -

Thanks but I need more than that I dont know programming!! So can you
change the macro for me please??
 
J

Jim Cone

See...
http://www.lmgtfy.com/?q=replacement+for+filesearch+in+excel



"Dave" <[email protected]>
wrote in message
FileSearch was removed from Excel in the 2007 version.
The VBA Dir function or the Scripting FileSystemObject can be used to replace it.
--
Jim Cone
Portland, Oregon USA
http://www.mediafire.com/PrimitiveSoftware .
(List Files add-in: lists specific files/folders with hyperlinks) .






- Show quoted text -



Thanks but I need more than that I dont know programming!! So can you
change the macro for me please??
 

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