MrExcel Publishing
Your One Stop for Excel Tips & Solutions

Allow Print, but not Copy or Save?!?!?


Posted by Dustin on March 28, 2001 2:19 PM

Is there any way to protect a spreadsheet so that the recipient can view and print the sheet, but not copy the contents to another sheet or save the sheet?


Posted by Dave Hawley on March 28, 2001 2:25 PM

Hi Dustin

Right click on the sheet name tab you want to stop from being copied and select "View Code" then paste in this :


Private Sub Worksheet_Deactivate()
Application.CutCopyMode = False
End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
Application.CutCopyMode = False
End Sub


Push Alt+Q and apply any other protection needed.

Dave

OzGrid Business Applications

Posted by Dustin on March 28, 2001 2:29 PM

Dave,
Thanks again.
Dustin

Posted by Dave Hawley on March 28, 2001 2:29 PM

Oops, forgot the save bit.

Right click on the sheet picture top left next to "File" and paste in this code:

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

Dave
OzGrid Business Applications

Posted by Aladin Akyurek on March 28, 2001 3:03 PM

Info?

Hi Dustin

Does that INDIRECT work now or what?

Aladin

Posted by Dustin on March 29, 2001 1:14 PM

Aladin, Sorry for not getting back sooner...

Aladin,
I got switched off of that particular project for a short while and I have been so swamped on my new task that I have not even had a chance to try it. I will email you once I do.
Thanks again,
Dustin