LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default printing a print area to a non default printer


Ive been printing to a select area to PDF, using a VBA code and setting
my default print to a program I have installed, CutePDF Writer, using
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 printer
and im struggling to write the code to continue writing to CutePDF
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!!


--
mikegibson
------------------------------------------------------------------------
mikegibson's Profile: 805
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=192865

http://www.thecodecage.com/forumz

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
If no default printer Open Print Diablog box Gerard Sanchez Excel Programming 2 December 6th 09 05:33 AM
store default printer, change printer and then restore default printer? Dennis Pedersen Excel Programming 0 November 14th 07 09:18 PM
Printing to Local Printer and the not the default printer. [email protected] Excel Programming 1 September 13th 07 02:18 PM
members on my network printer not able to print to default printer smeheut Excel Discussion (Misc queries) 0 June 18th 07 06:42 PM
Printing from default printer Susan Excel Discussion (Misc queries) 1 February 1st 06 04:23 PM


All times are GMT +1. The time now is 04:17 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"