Disable AutoOpen macro's

M

Michael Beckinsale

Hi All,

I have a macro that l run from a workbook which requires a second workbook
to be opened.

The second workbook contains a AutoOpen macro, the code of which is in the
ThisWorbook object. The AutoOpen macro prompts the user for Yes/No answers
upon opening via message boxes.

I would like to disable the AutoOpen macro on the second workbook when it is
opened via the VBA code in the 1st workbook.

The code l have used is

Workbooks.Open ("BLB0000")

The online help states that the above code will NOT initiate the AutoOpen
macro but that does not seem to be the case !

I am developing the code in Excel 2000 but it will be also need to be used
on Excel 97.

Any help greatly appreciated.

Michael Beckinsale.
 
B

Bernie Deitrick

Michael,

Use:

Application.EnableEvents = False
Workbooks.Open FileName:="BLB0000"
Application.EnableEvents = True

HTH,
Bernie
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top