Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 208
Default 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...
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default 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...

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default 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...


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
disable print Alberto Ast[_2_] Excel Discussion (Misc queries) 11 January 20th 10 07:06 PM
How To Disable The File, Print... And The Print Button Functions Andy Excel Programming 6 July 12th 08 01:04 AM
Disable print function on current workbook AvalancheMike Excel Programming 1 October 9th 06 03:43 PM
Disable print not working [email protected] Excel Programming 2 September 26th 06 04:14 AM
disable print Walter P Excel Discussion (Misc queries) 6 July 20th 06 08:12 PM


All times are GMT +1. The time now is 05:41 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"