ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   In Excel 2003 is there a way to prevent "Save As" and "Print"? (https://www.excelbanter.com/excel-discussion-misc-queries/138856-excel-2003-there-way-prevent-save-print.html)

lucky2000

In Excel 2003 is there a way to prevent "Save As" and "Print"?
 


Bernie Deitrick

In Excel 2003 is there a way to prevent "Save As" and "Print"?
 
Private Sub Workbook_BeforePrint(Cancel As Boolean)
Cancel = True
End Sub

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
If SaveAsUI Then Cancel = True
End Sub


Copy the above code into the Thisworkbook codemodule. Note that they will be defeated easily by any
knowledgeable user....

HTH,
Bernie
MS Excel MVP


"lucky2000" wrote in message
...




lucky2000

In Excel 2003 is there a way to prevent "Save As" and "Print"?
 
Thank you for your response, one more question if I may persist.... can
'copy/paste' also be defeated in some easy fashion as
'save as' and 'print' were in your explanation?

"Bernie Deitrick" wrote:

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Cancel = True
End Sub

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
If SaveAsUI Then Cancel = True
End Sub


Copy the above code into the Thisworkbook codemodule. Note that they will be defeated easily by any
knowledgeable user....

HTH,
Bernie
MS Excel MVP


"lucky2000" wrote in message
...





Bernie Deitrick

In Excel 2003 is there a way to prevent "Save As" and "Print"?
 
Yes, sort of, kind of, not as reliably....

This should prevent copying a range and pasting it over itself:

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
If Application.CutCopyMode < False Then
With Application
.EnableEvents = False
.Undo
.CutCopyMode = False
.EnableEvents = True
End With
End If
End Sub

This will prevent copying one range and pasting over another range:

Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
If Application.CutCopyMode < False Then Application.CutCopyMode = False
End Sub



--
HTH,
Bernie
MS Excel MVP


"lucky2000" wrote in message
...
Thank you for your response, one more question if I may persist.... can
'copy/paste' also be defeated in some easy fashion as
'save as' and 'print' were in your explanation?

"Bernie Deitrick" wrote:

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Cancel = True
End Sub

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
If SaveAsUI Then Cancel = True
End Sub


Copy the above code into the Thisworkbook codemodule. Note that they will be defeated easily by
any
knowledgeable user....

HTH,
Bernie
MS Excel MVP


"lucky2000" wrote in message
...








All times are GMT +1. The time now is 05:45 AM.

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