Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 172
Default Code to Exit Excel

I currently use a close workbook code, but
have decided to rather have a exit Excel
code.
Is this possible?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Code to Exit Excel

Corey,

Application.Quit

will complete terminate Excel.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Corey" wrote in message
...
I currently use a close workbook code, but
have decided to rather have a exit Excel
code.
Is this possible?


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 172
Default Code to Exit Excel

Thnaks
How can i place a SAVE step before that then Exit?
Corey....
"Chip Pearson" wrote in message
...
Corey,

Application.Quit

will complete terminate Excel.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Corey" wrote in message
...
I currently use a close workbook code, but
have decided to rather have a exit Excel
code.
Is this possible?



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Code to Exit Excel

Try

Dim WB As Workbook
For Each WB In Workbooks
WB.Close savechanges:=True
Next WB
Application.Quit


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Corey" wrote in message
...
Thnaks
How can i place a SAVE step before that then Exit?
Corey....
"Chip Pearson" wrote in message
...
Corey,

Application.Quit

will complete terminate Excel.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Corey" wrote in message
...
I currently use a close workbook code, but
have decided to rather have a exit Excel
code.
Is this possible?





  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 172
Default Code to Exit Excel

I now get a save, but a close instead of an exit??
"Chip Pearson" wrote in message
...
Try

Dim WB As Workbook
For Each WB In Workbooks
WB.Close savechanges:=True
Next WB
Application.Quit


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Corey" wrote in message
...
Thnaks
How can i place a SAVE step before that then Exit?
Corey....
"Chip Pearson" wrote in message
...
Corey,

Application.Quit

will complete terminate Excel.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Corey" wrote in message
...
I currently use a close workbook code, but
have decided to rather have a exit Excel
code.
Is this possible?









  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Code to Exit Excel

If a workbook has never been saved to disk, you'll get the Save
As dialog. If you don't want to save the workbooks before closing
Excel, change
savechanges:=True
to
savechanges:=False


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Corey" wrote in message
...
I now get a save, but a close instead of an exit??
"Chip Pearson" wrote in message
...
Try

Dim WB As Workbook
For Each WB In Workbooks
WB.Close savechanges:=True
Next WB
Application.Quit


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Corey" wrote in message
...
Thnaks
How can i place a SAVE step before that then Exit?
Corey....
"Chip Pearson" wrote in message
...
Corey,

Application.Quit

will complete terminate Excel.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Corey" wrote in message
...
I currently use a close workbook code, but
have decided to rather have a exit Excel
code.
Is this possible?









Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Exit Code Upon Cancel On Type 8 Input Box FARAZ QURESHI Excel Discussion (Misc queries) 2 March 31st 08 09:22 AM
Excel 07 won't exit Elle Setting up and Configuration of Excel 0 July 27th 07 12:40 AM
Execute vba code on cell exit Bill (Unique as my name) Excel Discussion (Misc queries) 2 May 24th 07 03:48 PM
exit excel within vba Murat Demir HEKIMOGLU Excel Programming 1 August 11th 05 02:37 PM
If a called sub exit, how to the caller exit right away? luvgreen[_4_] Excel Programming 4 February 24th 04 05:06 PM


All times are GMT +1. The time now is 12:06 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"