Stop macro when open excel from VBA

  • Thread starter Thread starter Bill Li
  • Start date Start date
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
 
If you turn off events before opening the workbook you should be okay.

Application.EnableEvents = False

And then turn events back on.
 
Back
Top