Disable Print Function

S

Sean

I have a workbook with several sheets in it, and allow others to view the
data but want to prohibit any printing of the data. I have used the "Set
Print Area" to a specified empty cell on each worksheet, however others have
found if they go to the "Name Box" and enter there cell there then they can
click print and selection.

Basically I just want a way to disable all printing functions within a
workbook? Any help would be appreciated. Thank you...
 
C

Charabeuh

Hello,

Try this,

In your VBAproject, put the following code into your "ThisWorkbook" code:

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Cancel = True
msgbox "Sorry ! Printing is disabled"
End Sub
 
G

Gord Dibben

With event code in Thisworkbook module you can cancel printing.

Private Sub Workbook_BeforePrint(Cancel As Boolean)
MsgBox "you are not allowed to print"
Cancel = True
End Sub

Users must have enabled macros or the above won't fire.

To ensure they enable macros you must have a contingency plan which makes
the workbook useless and unviewable if they disable macros.

You also have to worry about them simply copy/pasting the data to another
workbook.

Or using a screen capture utility.


Gord Dibben MS Excel MVP
 

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