ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Prevent Workbook_Open macro (https://www.excelbanter.com/excel-programming/307561-prevent-workbook_open-macro.html)

big t

Prevent Workbook_Open macro
 
Hi everyone,

I am opening one workbook from another using this command:

Workbooks.Open(wbkname)

but when wbkname opens it runs the Workbook_Open subroutine in the
ThisWorkbook section.

Is there a way I can prevent it from running this code?

I am running XP and Excel 2003.
TIA
big t


Frank Kabel

Prevent Workbook_Open macro
 
Hi
not tested but try:
application.enableevents=false
Workbooks.Open(wbkname)
application.enableevents=true

--
Regards
Frank Kabel
Frankfurt, Germany

"big t" schrieb im Newsbeitrag
...
Hi everyone,

I am opening one workbook from another using this command:

Workbooks.Open(wbkname)

but when wbkname opens it runs the Workbook_Open subroutine in the
ThisWorkbook section.

Is there a way I can prevent it from running this code?

I am running XP and Excel 2003.
TIA
big t



big t

Prevent Workbook_Open macro
 
Thanks Frank, that worked a treat!

cheers
big t


"Frank Kabel" wrote:

Hi
not tested but try:
application.enableevents=false
Workbooks.Open(wbkname)
application.enableevents=true

--
Regards
Frank Kabel
Frankfurt, Germany

"big t" schrieb im Newsbeitrag
...
Hi everyone,

I am opening one workbook from another using this command:

Workbooks.Open(wbkname)

but when wbkname opens it runs the Workbook_Open subroutine in the
ThisWorkbook section.

Is there a way I can prevent it from running this code?

I am running XP and Excel 2003.
TIA
big t





All times are GMT +1. The time now is 08:49 PM.

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