Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Getting Run-time error '445'

Hi,

I am looking to get the list of excel files in a folder through VBA.
By browsing the net i found this

Sub Search_files()
Dim FileS As FileSearch
Dim F As Variant
Dim x As Integer
Set FileS = Application.FileSearch
With FileS
.NewSearch
.Filename = InputBox("Insert file name")
.LookIn = InputBox("Insert the path")
.SearchSubFolders = True
.Execute
End With
x = 1
For Each F In Application.FileSearch.FoundFiles
Cells(x, 1) = F
x = x + 1
Next F
End Sub

When the cursor goes to "Set FileS = Application.FileSearch" it says
the OBJECT DOESN'T SUPPORT THIS ACTION"

Kindly provide solution

Thanks'
Hari
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,549
Default Getting Run-time error '445'


FileSearch was removed from xl2007. Use the Dir function.
--
Jim Cone
Portland, Oregon USA
List Files add-in: http://tinyurl.com/ListFiles



"Hari"
wrote in message
Hi,
I am looking to get the list of excel files in a folder through VBA.
By browsing the net i found this

Sub Search_files()
Dim FileS As FileSearch
Dim F As Variant
Dim x As Integer
Set FileS = Application.FileSearch
With FileS
.NewSearch
.Filename = InputBox("Insert file name")
.LookIn = InputBox("Insert the path")
.SearchSubFolders = True
.Execute
End With
x = 1
For Each F In Application.FileSearch.FoundFiles
Cells(x, 1) = F
x = x + 1
Next F
End Sub

When the cursor goes to "Set FileS = Application.FileSearch" it says
the OBJECT DOESN'T SUPPORT THIS ACTION"

Kindly provide solution
Thanks'
Hari
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
run time error 1004 general odbc error excel 2003 vba Mentos Excel Programming 5 January 24th 11 02:56 PM
Error handling error # 1004 Run-time error [email protected] Excel Programming 3 May 20th 08 02:23 PM
Conditional Formatting - Run Time Error '13' Type Mismatch Error ksp Excel Programming 0 July 11th 06 07:06 AM
run-time error '1004': Application-defined or object-deifined error [email protected] Excel Programming 5 August 10th 05 09:39 PM
Befuddled with For Next Loop ------ Run - Time Error '13' Type Mismatch Error rdavis7408 Excel Programming 1 August 25th 04 03:54 AM


All times are GMT +1. The time now is 12:20 AM.

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"