Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
calling up information from a different worksheet. | Excel Worksheet Functions | |||
calling a cell value from another worksheet | Excel Programming | |||
vb.net calling worksheet by name | Excel Programming | |||
Calling a different worksheet??? | Excel Programming | |||
Calling a macro in another worksheet | Excel Programming |