SteveFairclough
IS-IT--Management
Hi
I am trying to get my code to select a PDF printer to generate PDF files. When I look at the properties of the printer in XP, the details are
Printer Name "Win2PDF"
Printer Port "PDFFILE:"
Therefore, my code for selecting the printer is
Application.ActivePrinter = "Win2PDF on PDFFILE:"
However, if I run this code, the following error is displayed
Run Time error '1004'
Method 'ActivePrinter' of object '_Application' failed
So, I then recordred a macro to select the printer and it came up with the following code
Application.ActivePrinter = "Win2PDF on NE04:"
So, now I'm confused. I need to run this Excel VBA project on three different computers and each one shows a different "NE" port name for the Win2PDF printer.
Finally, my question, How do I either detect which NE port name to use or force it to use the PDFFILE: port name ?
Any help will be appreciated.
PS. In case you haven't guessed, I'm quite new to VBA !
Steve Fairclough
I.T. Manager
I am trying to get my code to select a PDF printer to generate PDF files. When I look at the properties of the printer in XP, the details are
Printer Name "Win2PDF"
Printer Port "PDFFILE:"
Therefore, my code for selecting the printer is
Application.ActivePrinter = "Win2PDF on PDFFILE:"
However, if I run this code, the following error is displayed
Run Time error '1004'
Method 'ActivePrinter' of object '_Application' failed
So, I then recordred a macro to select the printer and it came up with the following code
Application.ActivePrinter = "Win2PDF on NE04:"
So, now I'm confused. I need to run this Excel VBA project on three different computers and each one shows a different "NE" port name for the Win2PDF printer.
Finally, my question, How do I either detect which NE port name to use or force it to use the PDFFILE: port name ?
Any help will be appreciated.
PS. In case you haven't guessed, I'm quite new to VBA !
Steve Fairclough
I.T. Manager