Printer Ports

G

Guest

I am trying to write a macro that allows you to print to a PDF from an excel
sheet. The problem I am running into is that when I have the Adobe Writer
"printer" selected it automatically says it's on Ne02. I need other people
to be able to use this worksheet and I know not everyone has their Adobe
writer on Ne02... Is there a way I can make that universal? I though of
having a popup box for you to input that, but some people using it might not
know enough, is there a way for the code to figure it out for itself? Thanks
in advance for any help.
 
G

Guest

Printer
Port
PDF


Use something like:

for i = 1 to 9
err.clear
On error resume Next
Application.ActivePrinter = "printername on Ne0" & i & ":"
if err.Number = 0 then exit for
On error goto 0
Next
On Error goto 0
 
G

Guest

That is perfect, although it seems to try to print twice for some reason...
Any thoughts?
 
G

Guest

there was nothing in my code that did a print. So I guess that would be in
your implementation.
 
G

Guest

Works on others computers, so I will have to look into it, thanks a lot this
is a perfect start!
 

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

Top