Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 414
Default replacement for Application.FileSearch in 2007

hi all.
I'm trying to do a macro that will have multiple components, and finally
realized that I need to do this in steps.
My first step is to build a component that will look in a directory for a
specific group of some 35 files, out of 750 files.
Our IT guy just bought us the new OALtd "Excel 2007 VBA" book, and I wasn't
able to locate a specific example of this.
I've also looked in the VBA help files and only found the
application.filesearch object.
And of course, I've found that this no longer works in 2007.
I've read some of the posts, as well as Ron De Bruin's post to another
individual here and looked at his webpage example:
http://www.rondebruin.nl/copy4.htm
From what I'm able to make sense of I've found the part that looks in the
directory for a specific file.
It's his Example_3 sub.
About half way through it, the code states:

FilesInPath = Dir(MyPath & "*.xl*")

I'm curious, with the Dir(), am I able to set a range of files that I want
to access, or would I be better off using a For To loop to open one file at a
time, over a range?
And, if I'm not stating this clearly enough, please ask.
As always, thanks again for your responses.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default replacement for Application.FileSearch in 2007

Hi Steve

Read the tip on the page

Tip 2: Use only files with a name that start with for example week
Use this then
FilesInPath = Dir(MyPath & "week*.xl*")

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



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"SteveDB1" wrote in message ...
hi all.
I'm trying to do a macro that will have multiple components, and finally
realized that I need to do this in steps.
My first step is to build a component that will look in a directory for a
specific group of some 35 files, out of 750 files.
Our IT guy just bought us the new OALtd "Excel 2007 VBA" book, and I wasn't
able to locate a specific example of this.
I've also looked in the VBA help files and only found the
application.filesearch object.
And of course, I've found that this no longer works in 2007.
I've read some of the posts, as well as Ron De Bruin's post to another
individual here and looked at his webpage example:
http://www.rondebruin.nl/copy4.htm
From what I'm able to make sense of I've found the part that looks in the
directory for a specific file.
It's his Example_3 sub.
About half way through it, the code states:

FilesInPath = Dir(MyPath & "*.xl*")

I'm curious, with the Dir(), am I able to set a range of files that I want
to access, or would I be better off using a For To loop to open one file at a
time, over a range?
And, if I'm not stating this clearly enough, please ask.
As always, thanks again for your responses.

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 Cleberton(Brazilian) Excel Discussion (Misc queries) 2 October 26th 09 01:21 PM
Problems with Application.FileSearch Jim Rech Excel Programming 0 December 15th 06 05:18 PM
What is better: Application.FileSearch or Dir ?? WhytheQ Excel Programming 9 October 25th 06 01:29 PM
Application.Filesearch EA Excel Programming 3 August 17th 06 10:07 AM
VBA Application.FileSearch Roger Frye Excel Programming 0 March 5th 04 04:07 AM


All times are GMT +1. The time now is 09:46 AM.

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"