ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Prevent Save/Publish (https://www.excelbanter.com/excel-programming/442714-prevent-save-publish.html)

ordnance1[_2_]

Prevent Save/Publish
 
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




All times are GMT +1. The time now is 08:11 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com