quit excel application

danclemson

New Member
Joined
Mar 13, 2002
Messages
11
Hi, All

I was trying to quit excel application using Quit method, after working with and closing all its workbooks. The code is simple as following:

excelApp.Quit
Set excelApp = Nothing

I got unhandled exception (access violation) says: "memory xxx refers memory xxx, can't read". So the application has to be closed manually.

What is the problem?
Thanks for all the input. / dan
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Dan,

I am not sure if this is what you want by just try using the following code to quit excel:
Excel.Application.Quit

I hope this helps.
Kind regards,
Al
 
Upvote 0
Al,
Thanks for the reply.

I tried what you said, and still get the same unhandled exception.

I can do all sorts of thing, like adding workbook to the application, getting memory used by the application, except quit the application.

Is there other way to close the application?

Thanks /dan
 
Upvote 0
i tried the Excel.Application.Quit to quit excel and it does work so i suggest that the other person retries it.
 
Upvote 0
I am using RoseScript, which is Basic Script language similar to VB.

I can't directly use Application.Quit.
It has to be called as:
myExcelApp.Application.Quit or
myExcelApp.Quit

dan
 
Upvote 0
One more thing is that myExcelApp.Quit works fine with my other scripts, but only this one I got memory access violation.

so I don't think there is the problem of syntax. It seems the program can't locate the application when trying to close it. But I can't figure out the reason, as I still can do things like adding workbook on this applicaition.

Thanks /dan
 
Upvote 0

Forum statistics

Threads
1,213,534
Messages
6,114,184
Members
448,554
Latest member
Gleisner2

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top