ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Problem with quitting Excel opened through automation (https://www.excelbanter.com/excel-programming/287218-problem-quitting-excel-opened-through-automation.html)

Michelle

Problem with quitting Excel opened through automation
 
Hi All

I open an instance of excel from access

dim xlapp = excel.application

set xlapp = new excel.application

I do all the stuff i need to do then

xlapp.quit
set xlapp = nothing

Excel appears to close but the process is still running in
the task manager. When i close access the process
disappears. I am running office 97

I have searched the net for a solution to this and all the
answers i find suggest that using the quit method should
work. However, it doesn't.

does anybody have a real solution to this problem.

thanks
michelle

Stephen Bullen[_3_]

Problem with quitting Excel opened through automation
 
Hi Michelle,

I open an instance of excel from access

dim xlapp = excel.application

set xlapp = new excel.application

I do all the stuff i need to do then

xlapp.quit
set xlapp = nothing

Excel appears to close but the process is still running in
the task manager. When i close access the process
disappears. I am running office 97

I have searched the net for a solution to this and all the
answers i find suggest that using the quit method should
work. However, it doesn't.

does anybody have a real solution to this problem.


Two things:

1. In the "I do all the stuff i need to do then", you may be using
unreferenced calls into the Excel object model (a common one being the
Cells() method), which will get you a brand new instance to play with.

2. If you've left anything open in Excel, the application.Quit may be
waiting for a 'Save changes' prompt.


Regards

Stephen Bullen
Microsoft MVP - Excel
www.BMSLtd.co.uk



Tonza

Problem with quitting Excel opened through automation
 
Have tested with

sub test()

do all the stuff i need to do then

Application quit

end su

--
Message posted from http://www.ExcelForum.com



All times are GMT +1. The time now is 07:00 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com