KelliDease
September 17th, 2001, 09:49 AM
I am trying to open an Excel workbook from a VB application, as follows:
'---------------------------
Dim wkbk As excel.Workbook
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?
Please note: Setting App.EnableEvents = False or DisplayAlerts = False does NOT solve this problem.
Thank you.
'---------------------------
Dim wkbk As excel.Workbook
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?
Please note: Setting App.EnableEvents = False or DisplayAlerts = False does NOT solve this problem.
Thank you.