Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have created an Auto_Open sub which does properly execute if the workbook
is opened via Windows. But if the same workbook is opened via a VBA statement from within another workbook, the Auto_Open does not execute even though the workbook in fact is opened. Any suggestions? -- Lon Sarnoff |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Lon,
See VBA help on the RunAutoMacros method. The following worked for me: Sub aMacro() Workbooks.Open "MyTest.xls" ActiveWorkbook.RunAutoMacros xlAutoOpen End Sub --- Regards, Norman "Lon Sarnoff" wrote in message ... I have created an Auto_Open sub which does properly execute if the workbook is opened via Windows. But if the same workbook is opened via a VBA statement from within another workbook, the Auto_Open does not execute even though the workbook in fact is opened. Any suggestions? -- Lon Sarnoff |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The activeworkbook line solved the problem. Thank you.
-- Lon Sarnoff "Norman Jones" wrote: Hi Lon, See VBA help on the RunAutoMacros method. The following worked for me: Sub aMacro() Workbooks.Open "MyTest.xls" ActiveWorkbook.RunAutoMacros xlAutoOpen End Sub --- Regards, Norman "Lon Sarnoff" wrote in message ... I have created an Auto_Open sub which does properly execute if the workbook is opened via Windows. But if the same workbook is opened via a VBA statement from within another workbook, the Auto_Open does not execute even though the workbook in fact is opened. Any suggestions? -- Lon Sarnoff |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Take a look at .runautomacros in VBA's help. (You have to run that other
auto_open sub yourself.) Lon Sarnoff wrote: I have created an Auto_Open sub which does properly execute if the workbook is opened via Windows. But if the same workbook is opened via a VBA statement from within another workbook, the Auto_Open does not execute even though the workbook in fact is opened. Any suggestions? -- Lon Sarnoff -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Auto_open and more.... | New Users to Excel | |||
Auto_open and more.... | New Users to Excel | |||
Auto_open | Excel Discussion (Misc queries) | |||
XLA auto_open | Excel Programming | |||
Beyond AUTO_OPEN | Excel Programming |