vba code to open workbooks

R

Rebecca1

Does anyone have a code that will open a workbook w/name Table.xls that is in
the same directory as the workbook w/name 248.xls that is open. I would
like for the Table workbook to open when a user opens 248 workbook.
 
F

FSt1

hi
in the this workbook module of 248.xls, put this code. change the file path
to your file path.
Private Sub Workbook_Open()
Workbooks.Open Filename:= _
"C:\your\file\path\table.xls"
End Sub
to install..
open the vb editor.....Alt+F11
in the project window(far left), expand project 248.xls. click on this
workbook.
in the code window(far right), click on the left drop down and select
workbook.
Private Sub Workbook_Open() should default.
past the above code....
Workbooks.Open Filename:= _
"C:\your\file\path\table.xls"
close the vb editor and save the file.
each time 248.xls is opened, table.xls will open.

regards
FSt1
 
R

Rebecca1

This works great! Just what I was looking for. After installing, I see
that I would like to take this a step further. Can you help me with a code
that will automatically minimize Table and also automatically close Table
when 248.xls is closed?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top