BioXhazard
BioXhazard

Reputation: 518

Excel - Creating a print macro

I recorded a macro to print an excel sheet when the button is pressed. But I want to specify the printer that it automatically prints to rather than give the user a choice. I'm also printing to a PDF so is there a way I can choose where I print to?

This is what I have so far:

Sub Publish()
    '
    ' Publish Macro
    ' Macro recorded 07/09/2010
    '
    ' Keyboard Shortcut: Ctrl+Shift+S
    '
        ActiveWindow.SelectedSheets.PrintOut Copies:=1
    End Sub

Upvotes: 3

Views: 18053

Answers (1)

JohnK813
JohnK813

Reputation: 1124

Try adding

Application.ActivePrinter = "Printer Name"

on the line above the PrintOut command. This link gives more information on ActivePrinter, even though it is geared more for MS Word.

Upvotes: 3

Related Questions