Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
opening excel files? | Excel Discussion (Misc queries) | |||
show most recent files first when opening excel files | Excel Discussion (Misc queries) | |||
Opening Quattro Pro for Windows files (*.WB1 Files) using Excel 20 | Excel Discussion (Misc queries) | |||
need help - excel files are not opening | Excel Discussion (Misc queries) | |||
Opening Excel files | Excel Discussion (Misc queries) |