ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Open wrkBook (auto_open) programmatically (https://www.excelbanter.com/excel-programming/307435-open-wrkbook-auto_open-programmatically.html)

Sean McPoland[_3_]

Open wrkBook (auto_open) programmatically
 
Hi ya'll

right Office 2003,

I have a workbook with an Auto_Open Macro. I am opening
the Workbook subsequently in Power point VBA.

I have tried using READONLY = true and Editable= (T&F)
however the auto_open macro still executes.

How do I simulate the manual method of Open without
running Auto_Open macro in VBA?

I tried the Workbook.RunAutoOpen but that didn't seem to
work but that only works after the workbook is open
rather than at the Application level.

Your help gratefully received.

regards
Sean

Tom Ogilvy

Open wrkBook (auto_open) programmatically
 
Macros named Auto_Open do not run when the workbook is opened
programmatically. If you are finding something different, then this is
unexpected behavior. RunAutoOpen is a method provided to run the auto_open
macros after the workbook is opened programmatically.

Any macros in the Workbook_Open event will run regardless of how the
workbook is opened. These can be suppressed with application.EnableEvents =
False before opening in xl2002 and later. In xl2000 and xl97, you have to
run a macro in excel itself to issue this command.

--
Regards,
Tom Ogilvy

"Sean McPoland" wrote in message
...
Hi ya'll

right Office 2003,

I have a workbook with an Auto_Open Macro. I am opening
the Workbook subsequently in Power point VBA.

I have tried using READONLY = true and Editable= (T&F)
however the auto_open macro still executes.

How do I simulate the manual method of Open without
running Auto_Open macro in VBA?

I tried the Workbook.RunAutoOpen but that didn't seem to
work but that only works after the workbook is open
rather than at the Application level.

Your help gratefully received.

regards
Sean




Sean McPoland[_3_]

Open wrkBook (auto_open) programmatically
 
Thanks Tom,

you hit it on the nail, it was the Enable Events I was
looking for - and yes my macro was in WorkBook_Open

regards
Sean



-----Original Message-----
Macros named Auto_Open do not run when the workbook is

opened
programmatically. If you are finding something

different, then this is
unexpected behavior. RunAutoOpen is a method provided

to run the auto_open
macros after the workbook is opened programmatically.

Any macros in the Workbook_Open event will run

regardless of how the
workbook is opened. These can be suppressed with

application.EnableEvents =
False before opening in xl2002 and later. In xl2000 and

xl97, you have to
run a macro in excel itself to issue this command.

--
Regards,
Tom Ogilvy

"Sean McPoland"

wrote in message
...
Hi ya'll

right Office 2003,

I have a workbook with an Auto_Open Macro. I am

opening
the Workbook subsequently in Power point VBA.

I have tried using READONLY = true and Editable= (T&F)
however the auto_open macro still executes.

How do I simulate the manual method of Open without
running Auto_Open macro in VBA?

I tried the Workbook.RunAutoOpen but that didn't seem

to
work but that only works after the workbook is open
rather than at the Application level.

Your help gratefully received.

regards
Sean



.



All times are GMT +1. The time now is 07:32 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com