ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Disable Print Function (https://www.excelbanter.com/excel-programming/439367-disable-print-function.html)

Sean

Disable Print Function
 
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...

Charabeuh[_5_]

Disable Print Function
 
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




"Sean" wrote:

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...


Gord Dibben

Disable Print Function
 
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

On Tue, 9 Feb 2010 15:38:01 -0800, Sean
wrote:

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...




All times are GMT +1. The time now is 03:13 AM.

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