Block users from saving document

CraigFord

New Member
Joined
Sep 5, 2011
Messages
39
Hi

i have created a master document that i want anybody to be able to use, input data ect, however i dont want them to be able to save over the master

there are 2 macros in the docuemnt, one uses save as and the other uses export to pdf, these need to remain uneffected,

i gave tried to save the document as a template but it stops my macros working correctly.

what is the best way to do this?
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Try this in the ThisWorkbook module

Code:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
If Not SaveAsUI Then
    Cancel = True
    MsgBox "You can only Save As", vbInformation, "NOT SAVED"
End If
End Sub
 
Upvote 0
Try this in the ThisWorkbook module

Code:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
If Not SaveAsUI Then
    Cancel = True
    MsgBox "You can only Save As", vbInformation, "NOT SAVED"
End If
End Sub

sorry, new to VB where do i find the ThisWorkbook Module
 
Upvote 0
Press ALT + F11 to open the Visual Basic Editor. In the Project window you should see ThisWorkbook. Double click it and paste in the code.
 
Upvote 0

Forum statistics

Threads
1,224,592
Messages
6,179,790
Members
452,942
Latest member
VijayNewtoExcel

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