Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 258
Default Calling another worksheet

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\EmployeeLi st.xls"

End Sub


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Calling another worksheet

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\EmployeeLi st.xls"

End Sub


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 269
Default Calling another worksheet

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\EmployeeLi st.xls"

End Sub


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
calling up information from a different worksheet. Jay Adams Excel Worksheet Functions 0 October 8th 06 09:33 AM
calling a cell value from another worksheet papadoc[_3_] Excel Programming 1 July 31st 06 04:02 PM
vb.net calling worksheet by name Barnie[_2_] Excel Programming 1 April 28th 06 10:54 AM
Calling a different worksheet??? Tywardreath Excel Programming 3 December 14th 05 09:56 PM
Calling a macro in another worksheet Tolga[_2_] Excel Programming 2 August 5th 04 07:03 PM


All times are GMT +1. The time now is 03:48 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"