[AccessD] Excel object behavior

Hewson, Jim JHewson at nciinc.com
Mon Sep 22 18:56:21 CDT 2008


I have done similar things, but in my experience it didn't matter what I did through code I couldn't get Excel to close.  It was always open in the task manager.  I finally found a reference somewhere (I don't remember where) that the only way to get it to close was to kill it.  IOW I ended up shelling out of Access and using the Killapp command line to enforce its closure.  I put that on the exit button on the mdb file.  Sometimes I could export another set of data with the Excel instance still open and it would open another instance.  With the kill command it closes all instances of Excel.  So far it has worked for me.
HTH

Jim

Jim Hewson



From: McGillivray, Don [IT]
Sent: Mon 9/22/2008 17:10
To: Access Developers discussion and problem solving
Subject: [AccessD] Excel object behavior


Hello, All

I have a procedure that exports a bunch of data to Excel, and then uses the Excel object model to manipulate the resulting spreadsheets (creating pivot tables, applying formatting, and the like.)  Usually it works as advertised, but some of my users are having a problem where the UI freezes (or maybe it just appears to freeze).

In trying to isolate the problem, I watched the effects of my code carefully, and I notice that the Excel instance that I create in code doesn't terminate until the procedure itself is finished.  This, despite the fact that I have closed, quit, and set to nothing all Excel related objects before the end of the procedure.  I know through experience that failing to terminate Excel objects correctly leaves the instance alive even at the end of the procedure.  So I assume that I'm killing them correctly since the instance does indeed die.

Can anybody tell me if I should expect to see the instance survive until the end of the proc, or is there something else I ought to be doing when I'm finished with Excel?

Thanks!

Don McGillivray


-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

################################################################################

This email transmission contains information from NCI Information Systems, Inc. 
that may be considered privileged or confidential and is intended solely for the 
named recipient.  If you have received this message in error, please contact the 
sender immediately and be aware that the use, copying or dissemination of this 
information is prohibited.

################################################################################



More information about the AccessD mailing list