open a workbook with events turned off

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.

Answer this question

open a workbook with events turned off

  • AndriesVermaak

    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.
  • Death_oClock

    Nice one Joe, just encase anyone else needs to know here is an example:

    Application.EnableEvents = False
    ActiveWorkbook.Save
    Application.EnableEvents = True



  • DrSudhaK

    Joe,

    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.



  • boulder_bum

    Hi,

    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.



  • tyler000

    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.
  • open a workbook with events turned off