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

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.

dk

MrExcel MVP
Joined
Feb 15, 2002
Messages
2,942
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.
 

Webgeek

New Member
Joined
Sep 10, 2002
Messages
3
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.
 

Forum statistics

Threads
1,181,687
Messages
5,931,423
Members
436,789
Latest member
portugeezers

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
Top