ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Closing an Unsaved (but Changed) Workbook (https://www.excelbanter.com/excel-programming/286541-closing-unsaved-but-changed-workbook.html)

Mike[_64_]

Closing an Unsaved (but Changed) Workbook
 
How do I close a worksheet that I've changed (at the same
time that I close Excel), but don't want the changes to be
permanent? I tried using the following code:

ActiveWorkbook.Saved = True
Application.Quit

However, it doesn't work; it still asks me whether I want
to save the changes.


No Name

Closing an Unsaved (but Changed) Workbook
 

ActiveWorkbook.Close SaveChanges:=False

-----Original Message-----
How do I close a worksheet that I've changed (at the same
time that I close Excel), but don't want the changes to be
permanent? I tried using the following code:

ActiveWorkbook.Saved = True
Application.Quit

However, it doesn't work; it still asks me whether I want
to save the changes.

.


Mike[_64_]

Closing an Unsaved (but Changed) Workbook
 
But once the workbook is closed, it won't reach the last
line and close Excel.
-----Original Message-----

ActiveWorkbook.Close SaveChanges:=False

-----Original Message-----
How do I close a worksheet that I've changed (at the same
time that I close Excel), but don't want the changes to be
permanent? I tried using the following code:

ActiveWorkbook.Saved = True
Application.Quit

However, it doesn't work; it still asks me whether I want
to save the changes.

.

.


Bill[_19_]

Closing an Unsaved (but Changed) Workbook
 
Switch the order

Application.Quit
ActiveWorkbook.Close SaveChanges:=False

Quits, but does not bring up save changes dialog

-----Original Message-----
But once the workbook is closed, it won't reach the last
line and close Excel.
-----Original Message-----

ActiveWorkbook.Close SaveChanges:=False

-----Original Message-----
How do I close a worksheet that I've changed (at the

same
time that I close Excel), but don't want the changes to

be
permanent? I tried using the following code:

ActiveWorkbook.Saved = True
Application.Quit

However, it doesn't work; it still asks me whether I

want
to save the changes.


Mike[_64_]

Closing an Unsaved (but Changed) Workbook
 
Thanks Bill!

-----Original Message-----
Switch the order

Application.Quit
ActiveWorkbook.Close SaveChanges:=False

Quits, but does not bring up save changes dialog

-----Original Message-----
But once the workbook is closed, it won't reach the last
line and close Excel.
-----Original Message-----

ActiveWorkbook.Close SaveChanges:=False

-----Original Message-----
How do I close a worksheet that I've changed (at the

same
time that I close Excel), but don't want the changes to

be
permanent? I tried using the following code:

ActiveWorkbook.Saved = True
Application.Quit

However, it doesn't work; it still asks me whether I

want
to save the changes.

.



All times are GMT +1. The time now is 01:20 AM.

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