LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 137
Default Retrieve data from external excel document

You might use the FileSearch Method. It will find ALL files that
match the criteria, which should be OK if there is just one.

With Application.FileSearch
'Standard FileSearch Stuff
.NewSearch
.LookIn = "c:\my folder"
.Filename = "*src data.XLS"
.SearchSubFolders = False
.Execute

For i = 1 To .FoundFiles.Count
'Find the name of the workbook without the directory info
WbFileName = Mid(.FoundFiles(i), InStrRev(.FoundFiles(i), "\") + 1,
200)
workbooks.Open .FoundFiles(i)

'Do your processing here ...

'then close the workbook
Workbooks(WbFileName).Close

Next i
End with

 
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
How do I retrieve changes to an unsaved excel document Jim Excel Discussion (Misc queries) 4 July 11th 08 11:02 PM
External data retrieve timescale Richard Edwards Links and Linking in Excel 1 April 27th 06 01:44 PM
External data retrieve timescale Richard Edwards[_4_] Excel Programming 1 April 27th 06 01:44 PM
How do I retrieve changes to an unsaved excel document Jim New Users to Excel 1 March 24th 06 01:56 AM
How can I retrieve an Excel document that I did not save? sdbpao Excel Discussion (Misc queries) 1 February 24th 06 02:07 AM


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