Prevent Save/Publish

O

ordnance1

I use the code below to prevent users from saving a copy of my spreadsheet
if it is opened as a Read Only document. Is there any to prevent them from
publishing the document to PDF?

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)

If ActiveWorkbook.ReadOnly = True Then
msgbox "You opened this calendar as Read Only. You are not allowed to
save this document."
ThisWorkbook.Close False
End If

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top