PC Review


Reply
Thread Tools Rate Thread

Can Macro command to open files?

 
 
Berj
Guest
Posts: n/a
 
      18th Dec 2007
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
 
Reply With Quote
 
 
 
 
Gary''s Student
Guest
Posts: n/a
 
      18th Dec 2007
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.
--
Gary''s Student - gsnu200761


"Berj" wrote:

> 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

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro command to open desktop mainframe icon tbmarlie Microsoft Access Macros 3 31st Aug 2007 02:44 AM
Macro to open a toolbar command =?Utf-8?B?SmltQUE=?= Microsoft Access Macros 2 25th Jul 2006 09:30 AM
Macro command to open a file sowetoddid Microsoft Excel Programming 20 10th Jun 2004 04:51 PM
Macro command to open a file sowetoddid Microsoft Excel Worksheet Functions 6 24th Apr 2004 01:16 AM
Unable to get Excel 2002 to open files from File/Open Command =?Utf-8?B?UkFD?= Microsoft Excel Crashes 0 23rd Apr 2004 06:46 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:04 PM.