Exit Excel

On Excel if you have the code for Exit as End This does not work
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Are you referring to an run-time created object?

Set MyObjectVariable = Nothing

The above should destroy the object and release memory. Replace variable with the one you're using.
Are you talking about the "End" in Excel VBA?
This won't close Excel, as it's just supposed to end the VBA-program(!!).
To close Excel from Excel-VBA use Application.Quit.
[ fanpages ]IT Services ConsultantCommented:
Further to Steiner's response...

If you have code in VB to create an instance of the MS-Excel object, thus:

  Dim objExcel                                          As Object
  Set objExcel = CreateObject("Excel.Application")
  objExcel.Visible = True


Then you'll need to invoke the .Quit method on the created object to close MS-Excel:
  Set objExcel = Nothing

Setting the objExcel object to Nothing releases resources in your local application only.


Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

doyledomAuthor Commented:
sry i didnt explain myself properly as in exit the program, Quit Excel
I think its eitehr Application.Quit or Application.Exit,,, i think its quit

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
[ fanpages ]IT Services ConsultantCommented:

I see you accepted Steve-Howes answer, even though Steiner offered the answer prior to this.


I'm confused, too. Maybe he did not read the answers posted before your 1st posting??
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.