Removing the Save function!

Fletchmeister

Board Regular
Joined
May 20, 2003
Messages
114
I am wanting to remove the save functionality from a worksheet that I have set up. Any ideas???

Thanks

Fletch (y)
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
Create a variable, say "yourvariable", then in its own module, put the following code: Public yourvariable As Boolean 'Set yourvariable for Save. Then, in "Workbook", "Before Save", put the following code. The user will be given a message when he tries to save the workbook.

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
If yourvariable = True Then GoTo endit: ' checks if your variable is true
MsgBox "You are not allowed to save this workbook. If you wish to leave, click on the EXIT PROGRAM button"
Cancel = True
endit:
End Sub

You can then write a macro like this:

Sub SaveProgram()
yourvariable = True
ActiveWorkbook.Save
End Sub

This will allow you to save the workbook under macro control when you wish to.

Hope this helps
 
Upvote 0
Hi Fletch,

Try this in ThisWorkbook:
Code:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
    Cancel = True
End Sub
HTH
 
Upvote 0
May I inquire as to why you want to remove this functionality?
Flethcmeister said:
I am wanting to remove the save functionality from a worksheet that I have set up. Any ideas???
 
Upvote 0
Because we have a log that people enter onto via a worksheet. They click on a button on this log that transfers their individual entries to a master log. Therefore I do not want them to save the log that they enter onto. It causes me great hassle as various users are not the most copus mentus! and tend to fiddle!

Therefore I want a quick solution to remove the save functionality of the worksheet. However the responses I have recieved are taking me a little while to comprehend!! lol

Fletch (y)
 
Upvote 0
Why not just put a ReadOnly password on the document so that the original cannot be saved over?
 
Upvote 0

Forum statistics

Threads
1,202,916
Messages
6,052,541
Members
444,591
Latest member
exceldummy774

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