I'm creating and running Excel from VB5/6 from a command button.
In order to keep the user from creating multiple instances of Excel, the first part of my command button routine closes the previous instance of Excel.
This works fine.
HOWEVER, when the next created instance of Excel comes up it is numbered Book2 instead of Book1.
WHY?
The code to close Excel is:
In order to keep the user from creating multiple instances of Excel, the first part of my command button routine closes the previous instance of Excel.
This works fine.
HOWEVER, when the next created instance of Excel comes up it is numbered Book2 instead of Book1.
WHY?
The code to close Excel is:
Code:
'close active workbook without saving any changes
oxlWB.Close False
oxlApp.Quit
Set oxlWS = Nothing
Set oxlWB = Nothing
Set oxlApp = Nothing
DoEvents
gblnExcelActive = False