![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Mar 2002
Location: Arkansas
Posts: 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 ] |
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: San Francisco, California USA
Posts: 10,388
|
|
|
|
|
|
|
#3 |
|
New Member
Join Date: Mar 2002
Location: Arkansas
Posts: 15
|
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 ] |
|
|
|
|
|
#4 |
|
New Member
Join Date: Mar 2002
Location: Arkansas
Posts: 15
|
I enterd the following VB code:
Private Sub Workbook_BeforePrint(Cancel As Boolean) Cancel = True End Sub It is still printing... Any suggestions. |
|
|
|
|
|
#5 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Helena, MT
Posts: 13,690
|
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)
|
|
|
|
|
|
#6 |
|
New Member
Join Date: Mar 2002
Location: Arkansas
Posts: 15
|
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. |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|