ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Code to Exit Excel (https://www.excelbanter.com/excel-programming/364572-code-exit-excel.html)

Corey

Code to Exit Excel
 
I currently use a close workbook code, but
have decided to rather have a exit Excel
code.
Is this possible?

Chip Pearson

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?



Corey

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?




Chip Pearson

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?






Corey

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?








Chip Pearson

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?











All times are GMT +1. The time now is 05:15 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com