View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Héctor Miguel Héctor Miguel is offline
external usenet poster
 
Posts: 434
Default Print path linked to cell

hi, Jase !

1) use constants for search/match your printers names according your output needs

2) build (and preserve) a sorted array of available printers (names only)...
this through - CreateObject("WScript.Network").EnumPrinterConnect ions

3) find (from the sorted array) the index for the current printer (ActivePrinter)

4) search the index (in the sorted array) for the "target" printer name (constant/s in item 1)

5) back/forward for matching index differences using SendKeys ONE instruction line PRIOR to...
show the printer selection dialog: - Application.Dialogs(xlDialogPrinterSetup).Show
(this should be "almost" invisible to the GUI and disregarding the applicable port connection)

6) perform your printing instructions

- repeat steps 3 to 5 for any printer change needs (at the end, return to the "original" ActivePrinter)

hth,
hector.

__ OP __
In a worksheet I am calling a printer from a cell on the worksheet itself.
The problem I am having is when I do this, the path name has to be very specific.
For example,1 of my printer option is "Main Printer on Ne03:".
So If I have my worksheet open on any other computer.
I must reinstall all the printers in a certain order
I believe this the "Ne03" portion of the path and name them all exactly otherwise it debugs on me when I try to print.

I have to select the path from the sheet because I am doing a looping code that goes back and forth between 2 sheets
and printing them in a colation fashion and I dont want to call the printer setup each time if i am trying to print multiple versions.

Any other suggestion how to call the printer from my sheet without having to give the exact path?