Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default application.filesearch error in office 2010

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,549
Default application.filesearch error in office 2010

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"
wrote in message
...
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default application.filesearch error in office 2010

On Mar 24, 11:54*am, "Jim Cone" wrote:
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"
wrote in ...



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- Hide quoted text -


- Show quoted text -


Thanks but I need more than that I dont know programming!! So can you
change the macro for me please??
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,549
Default application.filesearch error in office 2010

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



"Dave"
wrote in message
...
On Mar 24, 11:54 am, "Jim Cone" wrote:
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"
wrote in ...
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- Hide quoted text -

- Show quoted text -




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


Reply
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
Solution for Application.FileSearch Excel 2007-2010 Michel Demers[_2_] Excel Programming 2 November 23rd 10 12:28 AM
Application.FileSearch Error Howard31 Excel Programming 12 June 24th 09 05:39 PM
FileSearch in Office 2007 generates an error? XP Excel Programming 5 September 23rd 08 09:47 PM
application.filesearch error in excel 2007 Ramesh Excel Programming 3 February 11th 08 11:54 AM
Application file search error in Office XP No Name Excel Programming 0 October 22nd 03 05:06 AM


All times are GMT +1. The time now is 09:23 PM.

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

About Us

"It's about Microsoft Excel"