Click to See Complete Forum and Search --> : Disabling Excel Macros


KelliDease
September 4th, 2001, 03:57 PM
I am trying to open an Excel workbook from a VB application, as follows:

'---------------------------
Dim wkbk As excel.Workbook
'-- NOTE: App is an instance of the Excel Application object
Set wkbk = App.Workbooks.Open(sWorkbook, False, False)
'---------------------------

This works fine until I come across a workbook that has code in the Workbook_Open() method. When the code in this method is run it may cause a run-time error in Excel that I cannot trap in VB, which causes my application to break.

Does anyone know how to prevent the code in the Workbook_Open() method from running when the workbook is opened?

Thank you.