ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Specify network printer in Open for Output method? (https://www.excelbanter.com/excel-programming/388670-specify-network-printer-open-output-method.html)

Ed

Specify network printer in Open for Output method?
 
My apologies for double-posting - I inadvertently put this in the
general Excel group first.

Right now I have
Open "LPT1:" For Output As #1
But I can't use my LPT1 printer at the moment. Is there a way I can
specify a networked printer?

Ed


Tom Ogilvy

Specify network printer in Open for Output method?
 
Substitute the network name for LPT1

as an example, this worked for me in the past:

Sub Macro5()
Dim ctrl As Long
Dim tmpstr As String
Open "\\ARDAPS01\1D343E" For Output As #1
Print #1, "[Start of Printing Test]"
For ctrl = 1 To 10
tmpstr = "Printing Line " + Str(ctrl)
Print #1, tmpstr
Next
tmpstr = "[End of printing test]" + Chr(12)
Print #1, tmpstr
Close #1
End Sub


--
Regards,
Tom Ogilvy


"Ed" wrote:

My apologies for double-posting - I inadvertently put this in the
general Excel group first.

Right now I have
Open "LPT1:" For Output As #1
But I can't use my LPT1 printer at the moment. Is there a way I can
specify a networked printer?

Ed



Ed

Specify network printer in Open for Output method?
 
Hi, Tom. Thanks much - I will give this a try.

Ed

On May 3, 10:56 am, Tom Ogilvy
wrote:
Substitute the network name for LPT1

as an example, this worked for me in the past:

Sub Macro5()
Dim ctrl As Long
Dim tmpstr As String
Open "\\ARDAPS01\1D343E" For Output As #1
Print #1, "[Start of Printing Test]"
For ctrl = 1 To 10
tmpstr = "Printing Line " + Str(ctrl)
Print #1, tmpstr
Next
tmpstr = "[End of printing test]" + Chr(12)
Print #1, tmpstr
Close #1
End Sub

--
Regards,
Tom Ogilvy



"Ed" wrote:
My apologies for double-posting - I inadvertently put this in the
general Excel group first.


Right now I have
Open "LPT1:" For Output As #1
But I can't use my LPT1 printer at the moment. Is there a way I can
specify a networked printer?


Ed- Hide quoted text -


- Show quoted text -





All times are GMT +1. The time now is 05:13 PM.

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