A way to Open 2nd Workbook automatically

J

JackR

I need to be able to have another workbook open at the same time I open one.
So if I open workbook A , Workbook B will open automatically.

What is the best way to do that
 
B

blounty

use this code in the "This workbook" section in the workbook VBA.


Private Sub Workbook_Open()
Workbooks.Open Filename:= _
"C:\Documents and Settings\user\My Documents\Book14.xls"
End Sub

change the file name section to the location of the file you wish t
open and voila
 
J

JackR

Well I thought it worked, here is the code I have in the this workbook VBA,
but I get an error message saying " compile error: ambiguos name detected:
workbook_open"

Is there a way to fix that?
 
D

Dave Peterson

You only get one workbook_open event.

You'll have to merge the code from blounty into your existing workbook_open
procedure.
 
J

JackR

How would the formula go so that both events can take place?
I am still learning.

Thanks
 
D

Dave Peterson

Private Sub Workbook_Open()
'your existing code
'bounty's code here
Workbooks.Open Filename:= _
"C:\Documents and Settings\user\My Documents\Book14.xls"
end sub


How would the formula go so that both events can take place?
I am still learning.

Thanks
 
Top