[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 404
  • 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

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