Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations GregLocock on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stop printing huge spreadsheets

Status
Not open for further replies.

bpeirson

Structural
Apr 7, 2003
147
If your company uses large spreadsheets which were never intended for printout then you may have experienced someone accidentally printing that spreadsheet.

To stop this from happening insert this code into the "ThisWorkbook" object.

Code:
Private Sub Workbook_BeforePrint(Cancel As Boolean)

Cancel = True
MsgBox ("Do not print from ""Your spreadsheet name here"". Copy and paste the information you need to print into a new spreadsheet.")

End Sub

The annoyance of this stopping a legitimate print job is offset by watching 250 pages churn out of a network printer while some poor slob tries to figure out how to cancel the job.
 
Of course, depending on just how big the spreadsheet is, you could just warn the user and give the opportunity to cancel with a yes/no message box. Alternately, you could counter the blind button presser by requiring actual keyboard input ("Type 'YES' to continue printing") with an InputBox.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor