• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 405
  • Last Modified:

Exit Excel

On Excel if you have the code for Exit as End This does not work
0
doyledom
Asked:
doyledom
  • 2
  • 2
  • 2
  • +2
1 Solution
 
zzzzzoocCommented:
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
 
SteinerCommented:
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
 
[ 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:
 
  objExcel.Quit
 
  Set objExcel = Nothing

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

BFN,

fp.
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
doyledomAuthor Commented:
sry i didnt explain myself properly as in exit the program, Quit Excel
0
 
Steve-HowesCommented:
I think its eitehr Application.Quit or Application.Exit,,, i think its quit
0
 
[ fanpages ]IT Services ConsultantCommented:
Hi,

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

BFN,

fp.
0
 
SteinerCommented:
I'm confused, too. Maybe he did not read the answers posted before your 1st posting??
0
 
Steve-HowesCommented:
hmmm
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

  • 2
  • 2
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now