Exit Excel

Posted on 2003-12-01
Last Modified: 2010-05-01
On Excel if you have the code for Exit as End This does not work
Question by:doyledom
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
  • +2
LVL 17

Expert Comment

ID: 9850073
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.
LVL 11

Expert Comment

ID: 9850939
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.
LVL 35

Expert Comment

by:[ fanpages ]
ID: 9851008
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.


Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.


Author Comment

ID: 9851867
sry i didnt explain myself properly as in exit the program, Quit Excel

Accepted Solution

Steve-Howes earned 30 total points
ID: 9852312
I think its eitehr Application.Quit or Application.Exit,,, i think its quit
LVL 35

Expert Comment

by:[ fanpages ]
ID: 9858135

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


LVL 11

Expert Comment

ID: 9864823
I'm confused, too. Maybe he did not read the answers posted before your 1st posting??

Expert Comment

ID: 9867890

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question