[AccessD] Start Excel Automation

sgoodhall at comcast.net sgoodhall at comcast.net
Wed Mar 8 14:42:23 CST 2006


I have found that the safest thing to do is at the end of the execution, quit Excel and then set it to nothing.  

objExcel.quit 
set objExcel = nothing

If you crash during testing, the Excel instance may get left open.  If you have not set it to be visible, it can be a mess to get rid of it.  To do this:

set objExcel = new Excel.Application
objExcel.visible = true

Somewhere I have code that will run around and find all running instances of Excel (or Word) and terminate them.  If I can find it readily, I will post it.

Regards,

Steve Goodhall, PMP

-------------- Original message -------------- 
From: "Erwin Craps - IT Helps" <Erwin.Craps at ithelps.be> 

> You probably don't set your object(s) to Nothing after executing your 
> code. 
> 
> Like 
> set objExcel = Nothing 
> 
> 
> 
> -----Original Message----- 
> From: accessd-bounces at databaseadvisors.com 
> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Carlo van der 
> Zon (Access IT Training) 
> Sent: Wednesday, March 08, 2006 8:21 PM 
> To: Access Developers discussion and problem solving 
> Subject: [AccessD] Start Excel Automation 
> 
> Hi 
> 
> I start Excel from code, fill a list, and Works fine. 
> I recorded a macro to create a pivottable, paste it in the Access code 
> and it Works fine. 
> 
> But just only the first time!! Is there any way to make sure just only 1 
> Excel instance is running?? 
> 
> Thanks 
> Carlo 
> 
> 
> 
> -- 
> AccessD mailing list 
> AccessD at databaseadvisors.com 
> http://databaseadvisors.com/mailman/listinfo/accessd 
> Website: http://www.databaseadvisors.com 
> -- 
> 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