[AccessD] Problem with Access VBA makes Excel Orphan

Perry L Harold pharold at proftesting.com
Fri Nov 13 15:10:44 CST 2009


I saw an example where the order made a difference.  It suggested
closing in this order.

    ExcelwBook.Save
    ExcelApp.Quit 
    ExcelwBook.Close False

Maybe it will make a difference.

Perry  


-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Edward Zuris
Sent: Friday, November 13, 2009 2:58 PM
To: accessd at databaseadvisors.com
Subject: [AccessD] Problem with Access VBA makes Excel Orphan


 Using the below code from an Access 2000 VBA  application, once running
these commands there  is still an Excel job running in task manager.
 
 The Excel orphan makes it impossible to run the  VBA application
recessively.
 
 One clue is Excel will finally shut down if  the Access 2000 VBA
application / database  is shutdown.
 
 Any way to tell Excel to just shut down ?
 
 Is there a work-a-round for this problem ?
 
 Thanks.
 
 Sincerely,
 Edward Zuris.

 -
 
 =======================================================
 ====== .Quit code not closing Excel Application ======
 
    Dim ExcelApp            As Excel.Application
    Dim ExcelwBook          As Excel.Workbook
    . . .
    Set ExcelApp = New Excel.Application
    Set ExcelwBook = ExcelApp.Workbooks.Add
    . . .
    ExcelApp.DisplayAlerts = False
    ExcelwBook.SaveAs zPath & zName
    ExcelApp.DisplayAlerts = True
 
    ExcelwBook.Save
    ExcelwBook.Close False
    ExcelApp.Quit
 
    Set ExcelwBook = Nothing
    Set ExcelApp = Nothing
 
 =======================================================
 =======================================================
 -
 
 Yet a simpler VBA applications doesn't have  this issue using the
following.
 
 This also fails using the complex VBA program.
 
 Any ideas ?
 
 =======================================================
 = .Quit code Working closing simple Excel Application =
 
    ExcelwBook.Application.DisplayAlerts = False
    ExcelwBook.SaveAs zPath & zName
    ExcelwBook.Application.DisplayAlerts = True
 
    ExcelwBook.Application.Quit
 
    ExcelApp.Quit
    
    Set ExcelwBook = Nothing
    Set ExcelApp = Nothing
 
 
 =======================================================
 =======================================================
 
 
--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list