M
mikegibson
Ive been printing to a select area to PDF, using a VBA code and settin
my default print to a program I have installed, CutePDF Writer, usin
this code (pressing Ctrl+T):
VBA Code:
--------------------
Sub printmy()
curPrtArea = ActiveSheet.PageSetup.PrintArea
myPrtArea = "A47:H133"
ActiveSheet.PageSetup.PrintArea = myPrtArea
ActiveSheet.PrintOut
ActiveSheet.PageSetup.PrintArea = curPrtArea
'
' printmy Macro
' Macro recorded 4/3/2010 by Mike Gibson
'
' Keyboard Shortcut: Ctrl+t
'
End Sub
--------------------
However I want to change the default printer back to my normal printe
and im struggling to write the code to continue writing to CutePD
Writer, (even though its not my default)
VBA Code:
--------------------
Sub printmy()
curPrtArea = ActiveSheet.PageSetup.PrintArea
myPrtArea = "A47:H133"
ActiveSheet.PageSetup.PrintArea = myPrtArea
ActiveSheet.PrintOut
ActiveSheet.PageSetup.PrintArea = curPrtArea
Dim Ptr As Printer
For Each Ptr In Printers
If Ptr.DeviceName = "CutePDF Writer" Then
Set Printer = Ptr
Exit For
End If
Next Ptr
'
' printmy Macro
' Macro recorded 4/3/2010 by Mike Gibson
'
' Keyboard Shortcut: Ctrl+t
'
End Sub
--------------------
Anyone have any ideas?
Happy Easter!!
my default print to a program I have installed, CutePDF Writer, usin
this code (pressing Ctrl+T):
VBA Code:
--------------------
Sub printmy()
curPrtArea = ActiveSheet.PageSetup.PrintArea
myPrtArea = "A47:H133"
ActiveSheet.PageSetup.PrintArea = myPrtArea
ActiveSheet.PrintOut
ActiveSheet.PageSetup.PrintArea = curPrtArea
'
' printmy Macro
' Macro recorded 4/3/2010 by Mike Gibson
'
' Keyboard Shortcut: Ctrl+t
'
End Sub
--------------------
However I want to change the default printer back to my normal printe
and im struggling to write the code to continue writing to CutePD
Writer, (even though its not my default)
VBA Code:
--------------------
Sub printmy()
curPrtArea = ActiveSheet.PageSetup.PrintArea
myPrtArea = "A47:H133"
ActiveSheet.PageSetup.PrintArea = myPrtArea
ActiveSheet.PrintOut
ActiveSheet.PageSetup.PrintArea = curPrtArea
Dim Ptr As Printer
For Each Ptr In Printers
If Ptr.DeviceName = "CutePDF Writer" Then
Set Printer = Ptr
Exit For
End If
Next Ptr
'
' printmy Macro
' Macro recorded 4/3/2010 by Mike Gibson
'
' Keyboard Shortcut: Ctrl+t
'
End Sub
--------------------
Anyone have any ideas?
Happy Easter!!