Use workbook_beforeclose without loosing the question "do you want to save your changes"

Tal

New Member
Joined
May 26, 2008
Messages
5
All, <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:eek:ffice:eek:ffice" /><o:p></o:p>
<o:p></o:p>
I wish to update the workbook each time it's being closed, and I do it by using workbook_beforeclose, and then ThisWorkbook.Save<o:p></o:p>
<o:p></o:p>
When working like that, I'm losing the excel functionality that checks if data was changed, and if it was, asking the user if he wishes to save his changes. <o:p></o:p>
<o:p> </o:p>
Is there a way to have it both? <o:p></o:p>
<o:p> </o:p>
Thanks, <o:p></o:p>
<o:p> </o:p>
Tal<o:p></o:p>
<o:p> </o:p>
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Only if you put a statemnt in the beginning
application.displayalerts=false
and at the end
application.displayalerts=true
it will not alert you.
probably in one of the macros the second statement has not inadvertenty added


try this.

in your code put a statemen in the beginning
application.displayalaerts=true

and see whether it helps
 
Upvote 0

Forum statistics

Threads
1,213,543
Messages
6,114,237
Members
448,555
Latest member
RobertJones1986

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top