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

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.

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,144,743
Messages
5,726,022
Members
422,653
Latest member
mntsiki

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