Disable Save Prompt in Excel

LTDragon07

New Member
Joined
Mar 13, 2015
Messages
8
is there a way to disable the save prompt when in an excel file?

I have a share macro excel sheet and I don't want it to ask to save the file.
When you manually close the file or Excel.
Is this possible?
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
Set the Saved property of the Workbook object to True within the workbook's BeforeClose event handler (Alt+F11 > Ctrl+R > right-click ThisWorkbook > Copy/paste > Alt+Q)...

Code:
Option Explicit

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

Hope this helps!
 
Upvote 0
Thanks, that helped.
I did make a change to this code that suited my needs a bit more.

Private Sub Workbook_BeforeClose(Cancel As Boolean)

If ThisWorkbook.ReadOnly = True Then
ThisWorkbook.Saved = True
Else
End If

End Sub
 
Upvote 0

Forum statistics

Threads
1,216,726
Messages
6,132,352
Members
449,719
Latest member
excel4mac

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