Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Excel VBA - Opening Files

fname = dir("C:\path1\*.xls")
do while fname < ""
set wkbk = workbooks.open("C:\path1\" & fname)
' process workbook
wkbk.close SaveChanges:=False ' or true
fname = dir()
Loop

--
Regards,
Tom Ogilvy


Brian wrote in message
...
How do I open up I folder and then open and close each file in that folder

consecutively? I am tring this:
Do Until FileName = today

Workbooks.Open FileName:= _
"Folder / FileName.xls"
Sheets("Sheet Name").Select
Range("N19").Select
Selection.Copy
ActiveWindow.Close
Windows("Window Name.xls").Activate
Range("B2").Select
ActiveSheet.Paste
Range("B3").Select

Loop




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
show most recent files first when opening excel files Anne` Excel Discussion (Misc queries) 5 January 23rd 08 01:54 AM
Excel files not opening [email protected] Excel Discussion (Misc queries) 13 November 16th 07 03:58 PM
Opening Quattro Pro for Windows files (*.WB1 Files) using Excel 20 PoundMutt Excel Discussion (Misc queries) 1 June 20th 07 03:50 AM
Opening Excel Files waynet Excel Discussion (Misc queries) 5 October 10th 05 03:31 PM


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