Cancel Save or Save as option

zoejenka

New Member
Joined
Jun 13, 2006
Messages
28
All,

I have a file that i want several people to have read only access to. I can make the file read only by putting a password onto the file. But ideally I would like to stop anyone being able to save the file as another name on their own desktop. This is to ensure that they will always be looking at the up to date version of the file.

Is there anyway I can do this?

Cheers,
Zoe.
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
In the ThisWorkbook module, put something like:

Code:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) 
Cancel = True 
Msgbox "You are not allowed to save this workbook."
End Sub
 
Upvote 0
Hi,

Just one query - Which I'm struggling with..

I am unable to save the code in the workbook - So when I reopen the workbook the the code is not there - Do you know a way round this?

Zoe.
 
Upvote 0
Hi,

set a breakpoint in the code before saving (click in the margin to the left of the line cancel = true)

then skip the line "cancel = true" (get the yellow handle and move to next line) and press function key F5
or
save again while the line is still highlighted (breakmode)

kind regards,
Erik
 
Upvote 0

Forum statistics

Threads
1,214,394
Messages
6,119,262
Members
448,880
Latest member
aveternik

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