Hello all.
I've just added some code to check for an environment supported by my Excel VBA app. At this time, is only Excel XP (version 10). If the version is NOT supported (i.e. Excel 2K), the workbook is closed without saving. Problem is, the VBA Project is still hanging around!!
I've verifed in the task manager that the Excel wkbk is gone. And not only that, but when I re-open wkbk, there now 2 of the same VBA Projects.
Below is the code in the Workbook_Open event. The Environ_OK is just a function that returns a boolean based on the Excel vesion.
Thanks for your help!
Innov
P.S. Is there a way to do this BEFORE all of the links a established, etc.
I've just added some code to check for an environment supported by my Excel VBA app. At this time, is only Excel XP (version 10). If the version is NOT supported (i.e. Excel 2K), the workbook is closed without saving. Problem is, the VBA Project is still hanging around!!
I've verifed in the task manager that the Excel wkbk is gone. And not only that, but when I re-open wkbk, there now 2 of the same VBA Projects.
Below is the code in the Workbook_Open event. The Environ_OK is just a function that returns a boolean based on the Excel vesion.
Thanks for your help!
Innov
P.S. Is there a way to do this BEFORE all of the links a established, etc.
Code:
Private Sub Workbook_Open()
Application.EnableCancelKey = xlDisabled
If trap_errors Then: On Error GoTo Err_Handler
error_source = "Workbook_Open"
initial_open = True
Application.Calculation = False
Application.EnableEvents = False
If Not Environ_OK Then
Application.DisplayAlerts = False
ThisWorkbook.Close (False) 'don't save changes since version not supported
Exit Sub
End If