Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
hello
i am having issues using VBA code for opening up workbooks within a workbook. i need to open up 6 other workbooks when the master workbook is opened. i was playing around with some code i found on this group and i got 1 to work, but then when it tried to open the second one it said error 1004 cannot open " or something like that. i have filenames of the workbooks i need to open stored in cells. i know i'm supposed to use some form of Workbooks.Open code in this somewhere, but thats about all i've got down, minus referencing the cells. sorry i'm a newb but we all have to start somewhere. anyone have any ideas for this code? for opening multiple workbooks? thanks in advance! aaron ward |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
oh i forgot to mention,
there is a possibility that the files the workbook will be looking for to open will not have been created yet. is there an if does not exist function or something i could use? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Private Sub Workbook_Open()
With Worksheets("Sheet1") Workbooks.Open Filename:=.Range("A1").Value Workbooks.Open Filename:=.Range("A2").Value Workbooks.Open Filename:=.Range("A3").Value 'etc. End With End Sub 'This is workbook event code. 'To input this code, right click on the Excel icon on the worksheet '(or next to the File menu if you maximise your workbooks), 'select View Code from the menu, and paste the code -- --- HTH Bob (change the xxxx to gmail if mailing direct) wrote in message ups.com... hello i am having issues using VBA code for opening up workbooks within a workbook. i need to open up 6 other workbooks when the master workbook is opened. i was playing around with some code i found on this group and i got 1 to work, but then when it tried to open the second one it said error 1004 cannot open " or something like that. i have filenames of the workbooks i need to open stored in cells. i know i'm supposed to use some form of Workbooks.Open code in this somewhere, but thats about all i've got down, minus referencing the cells. sorry i'm a newb but we all have to start somewhere. anyone have any ideas for this code? for opening multiple workbooks? thanks in advance! aaron ward |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
WOW! thanks bob, your code works great. thank you so much!
-aaron |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
do you know of any code off the top of your head that once all the
spreadsheets are open returns the vieable workspace to the original spreadsheet? -aaron |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
What exactly do you mean Aaron?
-- --- HTH Bob (change the xxxx to gmail if mailing direct) wrote in message ps.com... do you know of any code off the top of your head that once all the spreadsheets are open returns the vieable workspace to the original spreadsheet? -aaron |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro To consolidate All Open Workbooks Into One Workbook | Excel Worksheet Functions | |||
filenames and workbooks | Excel Programming | |||
Open workbooks - filenames change daily | Excel Programming | |||
How to automaticaly hide all toolbars in in workbook when another workbooks are open? | Excel Programming | |||
copy sheet1 from all open workbooks to one workbook | Excel Programming |