Accessibility options


How to disable printing in Excel

Author: Stephen Wells
Date: Mon, 05 Apr 2010 09:30:00 GMT

How to stop someone printing from an Excel workbook

Q I want to be able prevent a user from printing any of the data contained in an Excel workbook. Can you help?

Dave Barber

A You can use a macro to do this. Press Alt & F11 to open the VBA for Excel editor. Double-click on ThisWorkbook in the left-hand panel. In the right-hand panel enter:

Private Sub workbook_BeforePrint(Cancel As Boolean) Cancel = True MsgBox “You cannot print this workbook”, vbInformation End Sub

Close the VBA editor and save the file. The Message Box is optional, but if a message is not displayed when someone tries to print the file they might think there is a problem with their computer. This macro will prevent the print preview being shown with Ctrl & F2. The workbook can’t be printed either via the regular menus or the keyboard shortcut Ctrl & P.

This answers your question, but bear in mind there is little total security in Excel. There are many ways users can extract data, formulas or graphics from a spreadsheet.

More features

Find legal advice and services online
Make the most of legal advice freely available on the internet Thanks to the internet you can do several things online that used to require a trip to a lawyer’s office, such as applying for a ...
10 useful free Google tools
Best known for its search engine, Google has developed a range of interesting and useful free tools. Here’s our pick of them Google made its name as a search engine but, over the years, it has ...
Working with windows in Windows
Microsoft Windows is all about – perhaps unsurprisingly – windows. We explain how to master them It may be stating the obvious, but windows are a fundamental part of Microsoft Windows. Almost ...
How to spot and avoid online scammers
Fake emails and websites can look very realistic, and trick thousands – but we explain how to outsmart them According to the website Bank Safe Online, 20 million UK citizens now access their ...
How to install and configure a monitor
Setting up a new display can be fiddly – we explain how to do it Not only are flat-panel LCD monitors cheaper than ever, but they are also bigger, brighter, clearer and easier to use. Replacing ...

Advertisement starts


Advertisement

Advertisement ends

News

Intel’s new Core vPro starts PC fight-back in the enterprise
Intel brings Sandy Bridge to business systems with features to keep the ...

Reviews

Dell PowerEdge M-Series Blade Server review
An impressive blade server system that can match anything from HP and ...

Features

Working with windows in Windows
Microsoft Windows is all about – perhaps unsurprisingly – windows. We ...

Workshops

Faster Windows with fewer visual effects
Fine-tuning the way Windows uses visual effects can improve performance in XP, Vista and 7

Videos

Review: Intel Classmate PC
Review: Intel Classmate PC. A classroom computer that's shock-resistant -

Free newsletter

Enter your email address below and receive your Free technology newsletter.

 
 
 

Advertisement starts



Advertisement ends