Save file only if filename is not equal to a specific name

rustym

New Member
Joined
Jul 22, 2010
Messages
18
Hello
I have created a worksheet as a template in Excel 2003 and I don't want it to be altered. The idea is that the user should only be able to save the file if they change the filename to something else other than "template.xls". They should still however be able to fill in cells and run macros from it as long as they don't save the changes.

I know that I need to use the Workbook_BeforeSave but I am having troubles with how to implement the code.

Any ideas would be greatly appreciated.

Cheers,

Rusty
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Why not just set the file to be Read-Only (in Windows Explorer -> Properties)?

This will allow the users to make any changes they want, but will NOT allow them to do a "Save" on the file, only a "Save As". So they can only save it under a different name (unless they purposely and maliciously went out to Windows Explorer and remove the "Read Only" property, but my guess if you are concerned will "accidental" overwriting).

The best thing about that is it doesn't require VBA, because if the user opened your file and disabled VBA, your code would never run and they would be able to alter your template and save over it.
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,875
Members
452,363
Latest member
merico17

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