Dealing with 3 Printer Ports

B

Brad

Hello,

My spreadsheet prints to a color printer for my users. Between the 4 users,
there was only 2 printer ports that it had to deal with ne01 and ne02. Now we
just added another user and they printer to ne04. How do I change my code to
accomodate this 3rd printer port. My code is below for the printing portion.
Thanks.

---
On Error Resume Next
Application.ActivePrinter = "HP Color LaserJet P_30 on Ne01:"
If Err.Number = 1004 Then
Application.ActivePrinter = "HP Color LaserJet P_30 on Ne02:"
Err.Clear
End If
 
W

William

Maybe this helps....

Sub test()
Dim i As Integer, x As String
On Error Resume Next
i = 0
For i = 1 To 4
x = "HP Color LaserJet P_30 on Ne0" & i & ":"
Application.ActivePrinter = x
If Application.ActivePrinter = x Then Exit Sub
Next i
End Sub

--


XL2003
Regards

William
(e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Printing Problems 1
Printer Names on a Network 5
Excel changing Default Printer 1
Code not printing to color printer 4
Need VBA help 3
PDF995 on NE00 1
VBA to print Word Document 1
macro to print a Word Doc 0

Top