Can Macro command to open files?

  • Thread starter Thread starter Berj
  • Start date Start date
B

Berj

Hi all,
can anybody help me with this?

I need a command to add at the beginning of a macro which can be executed
when my Excel file NAMES.XLS is opening. The macro should be part of NAMES.XLS
This command should open another file named Q1.XLS

The Result: when I open NAMES.XLS, the other file, Q1.XLS must be opened
with it too. Then NAMES.XLS be the active file once again.

Thanks in advance,
Berj
 
Private Sub Workbook_Open()
ChDir "C:\Documents and Settings\Owner\Desktop\junk"
Workbooks.Open Filename:= _
"C:\Documents and Settings\Owner\Desktop\junk\Q1.xls"
Windows("NAMES.xls").Activate
End Sub

This goes in the NAMES.xls workbook code area.


Adjust the path to suite.
 
Back
Top