Auto Cancel Dialog Box

Webgeek

New Member
Joined
Sep 10, 2002
Messages
3
Is there a way to auto cancel the "This Document has been modified, do you want to save changes?" dialog box when opening a hyperlink from a web based Excel spreadsheet?
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Hello,

You could use this:-

Code:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Saved = True
End Sub

This needs to go in the Workbook code module, not a standard module. To do this right click the lower of the two Excel icons on the left hand side of your screen and choose View Code.
 
Upvote 0
Thanks for the reply, but it didn't work. :(

Trying to figure out how to "Cancel" the dialog box, not Save or Not Save. I'm not familiar enough with VBA to get it!

Thanks for the info tho, if you know of any other way, please reply.
 
Upvote 0

Forum statistics

Threads
1,214,527
Messages
6,120,054
Members
448,940
Latest member
mdusw

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