Can I only allow printing to pdf in Excel?

  • Thread starter Thread starter nanook
  • Start date Start date
N

nanook

I have created a template in Excel which has been set up so that the layout
is perfect when printing to pdf (which is how the document will mostly be
used) but the layout changes if printing direct to our printer. Is there a
way that I can ONLY allow printing to pdf from this document?
 
Hello

You may consider using some VBA to achieve this.
One way is to use the Workbook_BeforePrint event and specify the pdf printer
in the PrintOut method, eg:

Private Sub Workbook_BeforePrint(Cancel As Boolean)
ActiveSheet.PrintOut copies:=1, ActivePrinter:="CutePDF Writer on CPW2:"
End Sub

Please note you will need to amend the **activeprinter** name part of my
code to match precisely your pdf printer description.
To make sure that you use the correct printer description:
Set the default printer to your pdf printer
in a module paste this macro and note the exact description shown:
Sub ShowPrnName()
Msgbox Application.ActivePrinter
End Sub

Remember to set the previous default printer back.

HTH
Cordially
Pascal
 
Back
Top