ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Disabling an 'on load' macro (https://www.excelbanter.com/excel-worksheet-functions/84180-disabling-load-macro.html)

Gizmo63

Disabling an 'on load' macro
 
Hi guys,

I have a number of individual workbooks that execute a macro automatically
on load (it modifies the protection).
I also have a big 'consolidation' workbook that collates the info from all
the individual workbooks. The Consolidation opens the individual books
according to a defined list as 'read only', copies the info it needs and then
closes the individual book again.
The time waster here is the auto execute macro in the indivual books. Is
there an additional piece of code I can add that will stop the macro running.

I'm using:
Workbooks.Open [loadfile], UpdateLinks:=0, ReadOnly:=True
as the open code.

Cheers Giz

Bob Phillips

Disabling an 'on load' macro
 
Disable events before opening the book

Application.enableevents = false

and reset afterwards

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Gizmo63" wrote in message
...
Hi guys,

I have a number of individual workbooks that execute a macro automatically
on load (it modifies the protection).
I also have a big 'consolidation' workbook that collates the info from all
the individual workbooks. The Consolidation opens the individual books
according to a defined list as 'read only', copies the info it needs and

then
closes the individual book again.
The time waster here is the auto execute macro in the indivual books. Is
there an additional piece of code I can add that will stop the macro

running.

I'm using:
Workbooks.Open [loadfile], UpdateLinks:=0, ReadOnly:=True
as the open code.

Cheers Giz




Gizmo63

Disabling an 'on load' macro
 
Excellent - Thanks Bob.

"Bob Phillips" wrote:

Disable events before opening the book

Application.enableevents = false

and reset afterwards

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Gizmo63" wrote in message
...
Hi guys,

I have a number of individual workbooks that execute a macro automatically
on load (it modifies the protection).
I also have a big 'consolidation' workbook that collates the info from all
the individual workbooks. The Consolidation opens the individual books
according to a defined list as 'read only', copies the info it needs and

then
closes the individual book again.
The time waster here is the auto execute macro in the indivual books. Is
there an additional piece of code I can add that will stop the macro

running.

I'm using:
Workbooks.Open [loadfile], UpdateLinks:=0, ReadOnly:=True
as the open code.

Cheers Giz






All times are GMT +1. The time now is 10:34 AM.

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