Is there a way to open a workbook with the events disabled In other words, I would like to open a workbook so that links can be updated, but without executing the workbook_open or workbook_activate event procedures.
If you set your Macro security to medium or high then when you open the spreadsheet you will be prompted to enable or disable macros. If you select disable then your sheet will open but no code will run.
Joe_D
Posted: Visual Basic for Applications (VBA), open a workbook with events turned off
Thanks for your reply, but I did not quite explain my issue correctly. I would like to open a series of workbooks via VBA code, without triggering the events.
Derek Smyth
Posted: Visual Basic for Applications (VBA), open a workbook with events turned off
I'm not sure if you can do what your asking. The code in the Workbook_Open event should fire as the workbook is being opened. A different approach might be to extract the data from the spreadsheet which you can do using ADO, there is an example on my blog.
Joe_D
Posted: Visual Basic for Applications (VBA), open a workbook with events turned off
Aparrently, you can do it by disabling events just before opening the other workbook and reenabling the events just after closing it. This only works if you do not execute an enableevents in the other workbook while processing in it.
Derek Smyth
Posted: Visual Basic for Applications (VBA), open a workbook with events turned off