Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Network Printing - Selective Printers

Status
Not open for further replies.

Guest
I have a template that contains a sheet and 4 hiden sheets. All 5 sheets needs to be printed in color. There are two color printers installed on the network. I wrote a macro that asked the user which one of the two printers they wanted to use, and then printed the 5 sheets to the desired printer.

This works well, as long as a new printer is not installed . On installation of a new printer, the NeXX changes, which makes the macro bomb-out as it can not find the specified printer.

Application.ActivePrinter = "\\NYCG-FS1\PQ-HPLJ4500N-RESOURCES on Ne01:"

Is there any work-around for this problem I don't really want to use

Application.Dialogs(xlDialogPrinterSetup).Show

as this would show each users printers, including the non-color printers.

Any suggestions would be greatly appreciated.
 
Replies continue below

Recommended for you

Could you save the name of the printer along with the full network path to a seperate file and update it as necessary? You could keep this filename the same and have it reside on the same network drive all the time.

You could then open this file each time the user was going to print, read in the strings for both printers, and allow the user to choose it from that list? You could also incorporate a text description to the printer so that the user could be asked what model printer, the "name" of the printer, its location, etc. to print to.

This would require you (or someone else) to keep this file updated all the time, but that is better than changing the code each and every time.

Regards,
Tim S.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor