Prevent re naming of a workbook

Paul999

New Member
Joined
Apr 5, 2006
Messages
30
Is it possible to prevent users re naming a work book when saving, I have a work book which many people update recently someone saved it with a slightly different file name there by creating two it was a nightmare to workout which was the most up-to-date.

Is there anyway to prevent this.

Thanks in advance
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).

ADAMC

Well-known Member
Joined
Mar 20, 2007
Messages
1,169
Office Version
  1. 2013
Platform
  1. Windows
Hi something like:
Code:
Private Sub Workbook_Open()
Application.CommandBars("File").FindControl(ID:=748).Enabled = False
Application.CommandBars("File").FindControl(ID:=3).Enabled = False
End Sub
this will remove the save as and save options from the 'file menu'

then put them back in a before close event and peform a save...?
Code:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.CommandBars("File").FindControl(ID:=748).Enabled = True
Application.CommandBars("File").FindControl(ID:=3).Enabled = True
ActiveWorkbook.Save
End Sub

Edit*

Heres a very good overview of the subject:

http://www.rondebruin.nl/menuid.htm

This also shows you how to disable CTRL + S you could add this to the open event and switch back on in the close event.
 
Upvote 0

Forum statistics

Threads
1,190,836
Messages
5,983,166
Members
439,824
Latest member
jr599

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