Open workbook using VBA but don't run macros

G

Guest

What is the line I can use to open a spreadsheet (123.xls say), but not run
the macros that are in the open event of 123.xls

I can open the workbook using
workbooks.open FileName:= "C:\123.xls"
but the macros run.

How do I do this? Is it possible?
 
D

Dave Peterson

application.enableevents = false
workbooks.open filename:="C:\123.xls"
application.enableevents = true

You may want to do the same thing when you close the workbook.
 

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