Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21246

Excel Uses New Workbook Number Even though Previous Closed

$
0
0
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:

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


Viewing all articles
Browse latest Browse all 21246

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>