Simple clear advice in plain English

How to disable printing in Excel

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.

Reader Comments

   

Add your comment

All fields must be completed. Your email address will not be displayed or used to send marketing messages.

All messages will be checked by moderators before appearing on the site.

See our Privacy Policy for more information.

Related articles

Using Wizard to create a form

Create a good Base for your data

Databases may sound very dreary but they are behind almost everything we do. We explain how to go about starting one of your own using Libre Office Base

Extensions for Open Office Writer

Use Open Office Writer as a free alternative to Microsoft Word

Open Office Writer is a great piece of software that has hundreds of features. Here we show you 10 lesser-known features that you might not have discovered yet

335-shortcuts-lead

Keyboard shortcuts made easy

Discover how keyboard shortcuts could speed things up – and print out our free guide to help you master some of the most common PC keyboard shortcuts

Question & Answer

Q.How do I store musician and other information about...

> Read the answer

Q.Why can't my browser find the website address I typed...

> Read the answer

Q.All updates have been downloaded, so why won't Windows...

> Read the answer

Best deals on the web

img

Apple MacBook Pro (MC724LL/A)

£999.99- Buy it now

img

Sony Vaio VPCF23P1E/B

£679.98- Buy it now

img

Samsung 300E5A-A01DX

£449.99- Buy it now

Great benefits for subscribers!

Poll

Which is your preferred web browser

Jargon Buster

Computing terms explained in plain English

Router

A device used to connect more than one computer or other device to the internet.

Great shopping deals from Computeractive