Now the office is more and more inclined to paperless office, Excel2007 application has become more frequent. However, during the operation of the Excel2007 we may accidentally touch the Print button or some people do not pay much attention to saving, more casual printing Excel2007 files, or even directly prohibit ordinary people to print Excel2007 files. How do we reject file printing without affecting the Excel2007 file's edit-save growth operation?
In fact, this is relatively simple, we need to use a section of the macro instructions can be resolved, the specific operations are as follows:
Press ALT+F11 to open the VBA editor, and if the VBA project pane is not displayed, press the key combination ctrl+r to bring it up; Right-click "This Workbook", select "View Code", and then enter in the Code window:
The following is a code fragment: Private Sub Workbook_beforeprint (Cancel as Boolean) Cancel = True MsgBox "save paper refuse to print", vbinformation End Sub |
Then we press the key combination alt+f11 to return to Excel2007. In this way, whether you click the Print button directly, or choose "Print" from the Office Button, or use the shortcut key ctrl+p, you can not print directly, will only show you in the macro instructions entered in the prompt "save paper refused to print." This also lets you know that the reason for not printing is intentional, not hardware or software problems.