ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   1 touch printing macro (https://www.excelbanter.com/excel-programming/338669-1-touch-printing-macro.html)

tygi

1 touch printing macro
 

I have a problem setting up my printer macro. Excel sets up a printing
session that won't allow my macro to work. So is there a way to bypass
or override the printing session (Ne01) that it sets up? :mad: This
macro is supposed to choose a printer, then after printing the
document, it should change it back to the default printer. Please tell
me how to write the proper code.

*Sub Macro3()
'
' Macro3 Macro
' Macro recorded 8/12/2005 by Tygi

'
Application.ActivePrinter = "\\ATLAS\DoorshopRicoh1013F on Ne01:"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= _
"\\ATLAS\DoorshopRicoh1013F on Ne01:", Collate:=True
Application.ActivePrinter = "\\ATLAS\Ricoh1013FPCL6 on Ne01:"
End Sub*


--
tygi
------------------------------------------------------------------------
tygi's Profile: http://www.excelforum.com/member.php...o&userid=26769
View this thread: http://www.excelforum.com/showthread...hreadid=400260


bill k

1 touch printing macro
 

Not sure whether this could also be the problem at your
place.............but

I have been working with this solution for a while now.
We had the problem of the network assigning different numbers to the
network printers using Ne01, Ne02, Ne03 or Ne04.
This macro will search the possibilities and always find the right
one.
It will then execute the print job and go back to the default printer



Sub selectprntrandprintlbl()
Dim oldpname As String
Dim temppname As String
oldpname = Application.ActivePrinter
For j = 0 To 9
On Error Resume Next
temppname = "\\nzdfprn01\Label_UHT_Sato on Ne0" & j & ":"
Application.ActivePrinter = temppname
If Application.ActivePrinter = temppname Then
Exit For
End If
Next j
Application.ActivePrinter = "temppname"
prntlbl
'prntlbl is the name of a macro
Application.ActivePrinter = oldpname

End Sub

Hope that helps


--
bill k


------------------------------------------------------------------------
bill k's Profile: http://www.excelforum.com/member.php...nfo&userid=821
View this thread: http://www.excelforum.com/showthread...hreadid=400260



All times are GMT +1. The time now is 11:12 PM.

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