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

Hi,

I was using the following code in Excel 2003 to look in the specified
folder, and open files with ".xls" extension, and then do something
with the file.

With Application.FileSearch
.NewSearch
.LookIn = "D:\rspData"
.Filename = "*.xls"
If .Execute() 0 Then
For i = 1 To .FoundFiles.Count
varname = .FoundFiles(i)
Workbooks.Open Filename:=varname

In Excel 2007, FileSearch is giving an error. How could I achieve what
I want either by changing the code above or using some other code?

Thanks in advance for all the help.

Regards,
Raj
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 421
Default Problem with Filesearch in Excel 2007

Hi Raj.

Many people complained of problematic
performance with FileSearch and Excel
decided to drop it from Excel 2007.

You can use Dir or the FileSystemObject.

For examples of usage, see help or Google this
NG. See also Ron de Bruin's example usage at:

http://www.rondebruin.nl/copy3.htm


If you experience problems adapting your
code to these approaches, post back.




---
Regards.
Norman


"Raj" wrote in message
...
Hi,

I was using the following code in Excel 2003 to look in the specified
folder, and open files with ".xls" extension, and then do something
with the file.

With Application.FileSearch
.NewSearch
.LookIn = "D:\rspData"
.Filename = "*.xls"
If .Execute() 0 Then
For i = 1 To .FoundFiles.Count
varname = .FoundFiles(i)
Workbooks.Open Filename:=varname

In Excel 2007, FileSearch is giving an error. How could I achieve what
I want either by changing the code above or using some other code?

Thanks in advance for all the help.

Regards,
Raj


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
FileSearch Excel 2007 shaz Excel Discussion (Misc queries) 4 March 21st 10 02:07 AM
ms excel 2007 Filesearch Danny[_2_] Excel Programming 2 May 12th 08 09:29 PM
Filesearch error in Excel 2007 Libby Excel Programming 4 February 8th 08 08:51 PM
Excel 2007 filesearch Libby Excel Programming 3 February 8th 08 06:53 PM
replacement for filesearch in excel 2007 LWhite Excel Programming 1 September 10th 07 03:35 PM


All times are GMT +1. The time now is 06:54 PM.

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

About Us

"It's about Microsoft Excel"