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.
Article tags
Related articles
Q.How do I store musician and other information about...
Q.Why can't my browser find the website address I typed...
Q.All updates have been downloaded, so why won't Windows...
|
|
|
|
|
Nikon Coolpix S570 BlackPrice: £66.99 |
Computeractive Ultimate Guide - Storage, Sharing & BackupPrice: £5.99 |
Back Issue CD-Rom 13 (2010)Price: £9.99 |
Hallmark Card Studio DeluxePrice: £15.31 |
Marine AquariumPrice: £15.41 |