ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Workbook Before_Close question (https://www.excelbanter.com/excel-programming/302724-workbook-before_close-question.html)

Stuart[_5_]

Workbook Before_Close question
 
If user clicks the little 'x' in top right corner, then
I believe I can trap this with the Before_Close Event.
prior to the book closing.

Providing code has not saved the activeworbook
prior to this point, how do I Close without Saving
changes, please?

Regards.


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.710 / Virus Database: 466 - Release Date: 23/06/2004



Ron de Bruin

Workbook Before_Close question
 
Try this Stuart

how do I Close without Saving changes, please?


Private Sub Workbook_BeforeClose(Cancel As Boolean)
ThisWorkbook.Saved = True
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl


"Stuart" wrote in message ...
If user clicks the little 'x' in top right corner, then
I believe I can trap this with the Before_Close Event.
prior to the book closing.

Providing code has not saved the activeworbook
prior to this point, how do I Close without Saving
changes, please?

Regards.


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.710 / Virus Database: 466 - Release Date: 23/06/2004





Stuart[_5_]

Workbook Before_Close question
 
Got it.
Many thanks.

Regards

"Ron de Bruin" wrote in message
...
Try this Stuart

how do I Close without Saving changes, please?


Private Sub Workbook_BeforeClose(Cancel As Boolean)
ThisWorkbook.Saved = True
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl


"Stuart" wrote in message

...
If user clicks the little 'x' in top right corner, then
I believe I can trap this with the Before_Close Event.
prior to the book closing.

Providing code has not saved the activeworbook
prior to this point, how do I Close without Saving
changes, please?

Regards.


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.710 / Virus Database: 466 - Release Date: 23/06/2004






---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.710 / Virus Database: 466 - Release Date: 23/06/2004




All times are GMT +1. The time now is 11:58 PM.

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