Opening a second workbook automatically (1 Viewer)

Chris RR

Registered User.
Local time
Yesterday, 19:58
Joined
Mar 2, 2000
Messages
354
Hello,

In my main workbook, Costed_Menus, I've set up a drop down list that references a second workbook, Menu_Items. (Yes, we are talking real, food-type menus here.) This works perfectly if both workbooks are open.

What I want to do now is to set it up so that when my user opens Costed_Menus, that the Menu_Items workbook opens automatically. I'm sure that there is a way to do this in VBA. Where does the code belong? In the 'workbook open' event for Costed_Menus?

Thank you!
 

Access_guy49

Registered User.
Local time
Yesterday, 20:58
Joined
Sep 7, 2007
Messages
462
Private Sub Workbook_Open()
Application.Workbooks.Open ("Full:/Path/Of/Workbook.xls")
End Sub

This should work.
 

Chris RR

Registered User.
Local time
Yesterday, 19:58
Joined
Mar 2, 2000
Messages
354
Hi,
Thanks, I've got the workbook open.
Dim wkbkMenu_items As String
wkbkMenu_items = ActiveWorkbook.Path & "\" & "Menu_Items_only.xls"
Workbooks.Open wkbkMenu_items, 3​

The problem is that this puts the user into the second workbook. I want the user to be able to keep working in the first workbook. So I need to set focus to the first one, or minimize or hide the second one, or something along those lines.

I tried this right after the open.

Windows("Menu_Items_only").window1.Visible = False​
It's like I never get back to this line of code to execute it.
Thanks again.
 

smiler44

Registered User.
Local time
Today, 01:58
Joined
Jul 15, 2008
Messages
641
after the code in Costed_Menus that opens Menu_Items try
Code:
Windows("Costed_Menus.xls").Activate
so it looks like
Code:
Dim wkbkMenu_items As String
wkbkMenu_items = ActiveWorkbook.Path & "\" & "Menu_Items_only.xls"
Workbooks.Open wkbkMenu_items, 3
Windows("Costed_Menus.xls").Activate
 

Users who are viewing this thread

Top Bottom