Disabling Save/Save As for Excel 2010 Workbook

riffraf

New Member
Joined
Nov 13, 2014
Messages
2
I'm working with a client who has had version-control issues with their financial models. I created a button so that the workbook saves with a version number and date into a specified folder. I'd like for this to be the only way to save the workbook. I used the code in the ThisWorkbook section of the editor:

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Cancel = True
End Sub

This does the job when the model is the sole workbook open.

However, say I have another workbook open (as is typically the case) and then decide to open a version of the model I've saved in the past using my button. Now I can save/save as without using the button I created. This is a problem because someone could update things in an old model without creating a new version number and save over the old version or could save it to a location outside of where it should be saved.

Has anyone run into this before? How can I disable the save/ save as features even if my client's model is not the only workbook open?

Thanks very much.
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Hi and welcome to the MrExcel Message Board.

I don't think you will be able to do what you want with Excel macros. You really need to look at files permissions. Even with macros file deletion and renaming will still be possible. As will overwriting one file with another.

A product like Microsoft Sharepoint will keep versions for you but if you don't already use it it will be overkill (and expensive!). Otherwise you need to look at making things read-only and looking at this type of thing:

Prevent File Deletion and File Renaming in Windows

Controlling workbook access in Excel with Information Rights Management - Excel
 
Upvote 0

Forum statistics

Threads
1,215,477
Messages
6,125,037
Members
449,205
Latest member
Eggy66

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