Macro to Select Printer?

edzzz

Board Regular
Joined
Aug 19, 2002
Messages
145
Hi,

I'd asked a question a few weeks ago how to do this, but it was never answered. Now I'm just wondering if it's even possible.

I know that a macro can select print areas of various tabs and send them to your printer, but can a macro be written to select 1 of several printers? Just curious.

Thanks,
Ed
 
Thanks colosgps1975

That's a good trick re: paper trays, but my goal is actually to be able to set up a macro that will create a PDF without changing the default printer setting. I don't have the PDF Writer/Distiller installed yet, but I'm being "pro-active" so I'll be ready once I do. Thanks for the tip though. I can see that coming in handy down the road.

Ed
 
Upvote 0

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
What you can do is, store the "previous" printer in a variable, change the printer, do your thing, then restore the printer back... something like

Dim OldPrinter as String
OldPrinter = Application.ActivePrinter
Application.ActivePrinter = "yourprinterhere"
'Other stuff
Application.ActivePrinter = OldPrinter
 
Upvote 0

Forum statistics

Threads
1,213,543
Messages
6,114,243
Members
448,555
Latest member
RobertJones1986

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top