Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Filesearch error in Excel



Hi,
Can any one tell me how to enable a class in the object browser in VBA?
Filesearch is listed there in the hidden objects but it isn't enabled.
Is this possible, even though Microsoft took it out of Office 2007?

Thanks,

Brett

*** Sent via Developersdex http://www.developersdex.com ***
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,049
Default Filesearch error in Excel

This has been dropped in 2007.
see
http://support.microsoft.com/kb/935402/en-us
recommended use of the DIR() function or the FileSystemObject
The FileSystemObject is part of the Microsoft Scrioting Runtime, so in the
IDE set a reference to this (Tools/references)
Its not so easy, but here's an example to give you something to play with

OPTION EXPLICIT
Sub MyFileSearch()
Dim sfoFile As Scripting.File
With New FileSystemObject
For Each sfoFile In .GetFolder("C:\temp").Files
With sfoFile
If .Name Like "*.CSV" Then
Debug.Print .Name, .Type
End If
End With
Next
End With
End Sub



"Brett Nykiforuk" wrote in message
...


Hi,
Can any one tell me how to enable a class in the object browser in VBA?
Filesearch is listed there in the hidden objects but it isn't enabled.
Is this possible, even though Microsoft took it out of Office 2007?

Thanks,

Brett

*** Sent via Developersdex http://www.developersdex.com ***


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,049
Default Filesearch error in Excel

apologies for a typo
Microsoft Scrioting Runtime
should of course be
Microsoft Scripting Runtime

"Patrick Molloy" wrote in message
...
This has been dropped in 2007.
see
http://support.microsoft.com/kb/935402/en-us
recommended use of the DIR() function or the FileSystemObject
The FileSystemObject is part of the Microsoft Scrioting Runtime, so in the
IDE set a reference to this (Tools/references)
Its not so easy, but here's an example to give you something to play with

OPTION EXPLICIT
Sub MyFileSearch()
Dim sfoFile As Scripting.File
With New FileSystemObject
For Each sfoFile In .GetFolder("C:\temp").Files
With sfoFile
If .Name Like "*.CSV" Then
Debug.Print .Name, .Type
End If
End With
Next
End With
End Sub



"Brett Nykiforuk" wrote in message
...


Hi,
Can any one tell me how to enable a class in the object browser in VBA?
Filesearch is listed there in the hidden objects but it isn't enabled.
Is this possible, even though Microsoft took it out of Office 2007?

Thanks,

Brett

*** Sent via Developersdex http://www.developersdex.com ***


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
Application.FileSearch Error Howard31 Excel Programming 12 June 24th 09 05:39 PM
application.filesearch error in excel 2007 Ramesh Excel Programming 3 February 11th 08 11:54 AM
Filesearch error in Excel 2007 Libby Excel Programming 4 February 8th 08 08:51 PM
FileSearch error 1004 Daher Abdeen Excel Programming 4 September 19th 07 01:46 PM
Filesearch 1004 error with XL 2003 [email protected][_2_] Excel Programming 1 July 7th 05 05:47 PM


All times are GMT +1. The time now is 01:25 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"