ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Print path linked to cell (https://www.excelbanter.com/excel-discussion-misc-queries/206161-print-path-linked-cell.html)

jase

Print path linked to cell
 
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?

thanks,

Jase


Héctor Miguel

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?





All times are GMT +1. The time now is 07:31 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com