PC Review


Reply
Thread Tools Rate Thread

Calling another worksheet

 
 
Patrick Simonds
Guest
Posts: n/a
 
      9th Dec 2006
I need this Auto_Open() macro to open the document listed and it works fine,
my problem is that :

1. I do not want it to become the active document
2. The name of the document running this routine can change. Otherwise I
would just add a statement to make C:/xxx.xls active.

Sub Auto_Open()
'
' AutoRun Macro
' '

Workbooks.Open Filename:="O:\PT_DRIVER_SCHED\Templates\EmployeeList.xls"

End Sub


 
Reply With Quote
 
 
 
 
Dave Peterson
Guest
Posts: n/a
 
      9th Dec 2006
Add:

thisworkbook.activate

to get back to the workbook with the code.

Patrick Simonds wrote:
>
> I need this Auto_Open() macro to open the document listed and it works fine,
> my problem is that :
>
> 1. I do not want it to become the active document
> 2. The name of the document running this routine can change. Otherwise I
> would just add a statement to make C:/xxx.xls active.
>
> Sub Auto_Open()
> '
> ' AutoRun Macro
> ' '
>
> Workbooks.Open Filename:="O:\PT_DRIVER_SCHED\Templates\EmployeeList.xls"
>
> End Sub


--

Dave Peterson
 
Reply With Quote
 
Zone
Guest
Posts: n/a
 
      9th Dec 2006
Patrick, If the document you want to be active is the same as the
document containing the Auto_Open sub, put this line in your Auto_Open
sub just before the End Sub line:
ThisWorkbook.Activate
James
Patrick Simonds wrote:
> I need this Auto_Open() macro to open the document listed and it works fine,
> my problem is that :
>
> 1. I do not want it to become the active document
> 2. The name of the document running this routine can change. Otherwise I
> would just add a statement to make C:/xxx.xls active.
>
> Sub Auto_Open()
> '
> ' AutoRun Macro
> ' '
>
> Workbooks.Open Filename:="O:\PT_DRIVER_SCHED\Templates\EmployeeList.xls"
>
> End Sub


 
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
Calling a sub on another worksheet mooresk257 Microsoft Excel Programming 5 27th May 2010 10:32 PM
calling a worksheet function from another worksheet in same workbo Liz Microsoft Excel Programming 5 23rd Jun 2008 06:16 PM
Calling a Sub in a Worksheet =?Utf-8?B?SmltIEphY2tzb24=?= Microsoft Excel Programming 3 23rd Jul 2007 04:06 PM
vb.net calling worksheet by name Barnie Microsoft Excel Programming 1 28th Apr 2006 10:54 AM
Calling a different worksheet??? =?Utf-8?B?VHl3YXJkcmVhdGg=?= Microsoft Excel Programming 3 14th Dec 2005 09:56 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:15 PM.