ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Printing macro error (https://www.excelbanter.com/excel-programming/297188-printing-macro-error.html)

David

Printing macro error
 
I am trying to create a macro to print. It prints but I get run time
error 424 object required. WHat is wrong and how can I fix it? How
can I tell it ot print 3 copies of the active sheet?

Here's my code:

Sub prtout()
ActiveSheet.PrintOut.ActivePrinter
End Sub

Bob Flanagan

Printing macro error
 
Use:

ActiveWindow.SelectedSheets.PrintOut Copies:=3

or

ActiveSheet.PrintOut Copies:=3

Bob Flanagan
Macro Systems
http://www.add-ins.com
Productivity add-ins and downloadable books on VB macros for Excel


"David" wrote in message
om...
I am trying to create a macro to print. It prints but I get run time
error 424 object required. WHat is wrong and how can I fix it? How
can I tell it ot print 3 copies of the active sheet?

Here's my code:

Sub prtout()
ActiveSheet.PrintOut.ActivePrinter
End Sub




David

Printing macro error
 
That worked perfectly. Thank you very much. Could you direct me to
some resources for newbies who want to figure out VB code for
themselves? Much appreciated.

"Bob Flanagan" wrote in message ...
Use:

ActiveWindow.SelectedSheets.PrintOut Copies:=3

or

ActiveSheet.PrintOut Copies:=3

Bob Flanagan
Macro Systems
http://www.add-ins.com
Productivity add-ins and downloadable books on VB macros for Excel


"David" wrote in message
om...
I am trying to create a macro to print. It prints but I get run time
error 424 object required. WHat is wrong and how can I fix it? How
can I tell it ot print 3 copies of the active sheet?

Here's my code:

Sub prtout()
ActiveSheet.PrintOut.ActivePrinter
End Sub



All times are GMT +1. The time now is 04:53 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com