?
Solved

Exit Excel

Posted on 2003-12-01
8
Medium Priority
?
402 Views
Last Modified: 2010-05-01
On Excel if you have the code for Exit as End This does not work
0
Comment
Question by:doyledom
[X]
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
8 Comments
 
LVL 17

Expert Comment

by:zzzzzooc
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.
0
 
LVL 11

Expert Comment

by:Steiner
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.
0
 
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:
 
  objExcel.Quit
 
  Set objExcel = Nothing

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

BFN,

fp.
0
Industry Leaders: 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!

 

Author Comment

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

Accepted Solution

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

Expert Comment

by:[ fanpages ]
ID: 9858135
Hi,

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

BFN,

fp.
0
 
LVL 11

Expert Comment

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

Expert Comment

by:Steve-Howes
ID: 9867890
hmmm
0

Featured Post

Technology Partners: 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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month15 days, 1 hour left to enroll

771 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