Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default Opening numerious excel files

How do I open 2 or more excel files in one shot? If I create a macro to
launch a diolague box, Is there a way to select numerious .xls files or does
it only have to be performed one at a time?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 130
Default Opening numerious excel files

BZeyger,

Using the macro recorder you can capture this

Workbooks.Open Filename:= _
"<File 1.xls"
Workbooks.Open Filename:="<File 2.xls", UpdateLinks _
:=0
Workbooks.Open Filename:="<File 3.xls", UpdateLinks _
:=0
Workbooks.Open Filename:="<File n.xls", UpdateLinks _
:=0


"BZeyger" wrote:

How do I open 2 or more excel files in one shot? If I create a macro to
launch a diolague box, Is there a way to select numerious .xls files or does
it only have to be performed one at a time?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 168
Default Opening numerious excel files

Hello,

I found this code on microsoft.com, should work. Simple and elegant.


Sub Open_Files

'Defines the variable as a variant data type
Dim X as variant

'Continues to run the macro even if an error occurs
On Error Resume Next

'Opens the dialog
X = Application.GetOpenFilename _
("Excel Files (*.xls), *.xls, 2, "Open My Files", ,True)

'Tests the variable X to see if it is valid
If X = False then GoTo Cancel

'Loops through every file that is selected and opens each one
For Y = 1 to Ubound(X)
Workbooks.Open X(Y)
Next

Exit Sub

'If X was equal to false, displays a message and exits the
macro
Cancel:
Msgbox "The Cancel button was selected."

End Sub


Hope this helps,
JP


On Oct 5, 2:34 pm, BZeyger wrote:
How do I open 2 or more excel files in one shot? If I create a macro to
launch a diolague box, Is there a way to select numerious .xls files or does
it only have to be performed one at a time?



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
opening excel files? TravEyE Excel Discussion (Misc queries) 2 June 24th 09 11:11 PM
show most recent files first when opening excel files Anne` Excel Discussion (Misc queries) 5 January 23rd 08 01:54 AM
Opening Quattro Pro for Windows files (*.WB1 Files) using Excel 20 PoundMutt Excel Discussion (Misc queries) 1 June 20th 07 03:50 AM
need help - excel files are not opening wolfgang22 Excel Discussion (Misc queries) 1 May 18th 06 10:41 AM
Opening Excel files Bungalow Excel Discussion (Misc queries) 3 February 22nd 05 09:15 PM


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