Stop macro when open excel from VBA

B

Bill Li

Hello,

I have created a code to open other excel files. However,
in some of the excel files, there are some auto-run macro.
When I open these files via VBA, their auto-run macro will
be executed, which leads to error. If it is possible to
stop these auto-run macro when I open them via VBA. My
excel version is Excel 97 SR-2. The command to open the
file are as following:

Workbooks.Open FileName:="Test.xls",_
updatelinks:=False, _
ReadOnly:=True

Best Regards

Bill
 
J

Jim Rech

If you turn off events before opening the workbook you should be okay.

Application.EnableEvents = False

And then turn events back on.
 

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