Prohibiting Printing

ejd0077

New Member
Joined
Mar 4, 2002
Messages
15
I created a workbook in Excel that is viewed only by a select number of mgrs within my company. The workbook is password protected (both the open and to modify) in a shared drive. My superiors just asked if there was a way I could set it up that people could view the workbook but not be able to print it. Does anyone know of a way? Many thanks!

_________________
Beth
This message was edited by ejd0077 on 2002-03-05 14:50
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Thank you for your quick reply... The suggestions look just like what I am needing.

The workbook uses a pivot table that the mgrs can use to select different areas, so I think I am going to use the VB code instead of setting the print area and turning the sheet protection on.

AGAIN - many thanks. I would have researched this for days (probably to no avail). :)

_________________
Beth
This message was edited by ejd0077 on 2002-03-06 06:38
 
Upvote 0
I enterd the following VB code:

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

It is still printing... Any suggestions.
 
Upvote 0
Beth: Where are you putting the code? It needs to be in the WorkBook module. Right click on the Excel Icon next to the workbook name in the title bar and choose View Code to open the module. Paste the code here. You can also access the Workbook module from the VBA editor (ThisWorkbook)
 
Upvote 0
You were right!!! I was putting the code in the wrong place. After moving it to ThisWorkbook, it worked just fine!

I appreciate your help. I was getting a little anxious. :)
 
Upvote 0

Forum statistics

Threads
1,214,386
Messages
6,119,214
Members
448,874
Latest member
b1step2far

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top