Disabling an 'on load' macro

G

Gizmo63

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
 
B

Bob Phillips

Disable events before opening the book

Application.enableevents = false

and reset afterwards

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)
 
G

Gizmo63

Excellent - Thanks Bob.

Bob Phillips said:
Disable events before opening the book

Application.enableevents = false

and reset afterwards

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

Gizmo63 said:
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
 
Top