Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Printing according to computer
This is for anyone who needs it...
I needed a macro that would first check for the computername and then print a selected number of copies to that computers printer.. I needed this so I could use one main pricelist/workorder on all the mamchines in the office and still have the print button i made do what i needed. The complete macro does the following: 1. verifies that salesperson name has been entered 2. check which computer the pricelist is being run on 3. prints a set number of copies to the above running computer 4. emails the dept head a copy of the workorder (customer name & PO in filename) 5. resets the form for the next order. Here is the computer check part.. Set WshShell = CreateObject("WScript.Shell") Set ObjEnv = WshShell.Environment("Process") COMPUTERNAME = ObjEnv("COMPUTERNAME") If COMPUTERNAME = "GRAPHICS" Then ActiveWindow.ActiveSheet.PrintOut From:=1, To:=1, Copies:=2, Collate:=True, ActivePrinter:="Epson Color" Else If COMPUTERNAME = "OFFICE" Then ActiveWindow.ActiveSheet.PrintOut From:=1, To:=1, Copies:=2, Collate:=True, ActivePrinter:="Office Color" Else If COMPUTERNAME = "CUSTOMER" Then ActiveWindow.ActiveSheet.PrintOut From:=1, To:=1, Copies:=2, Collate:=True, ActivePrinter:="HP 1200" Else Thanks for everyones help wayne @ CNY Awards & Apparel, Inc. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Row Height variations from computer to computer on same workbook | Excel Discussion (Misc queries) | |||
Formulaed cell response varies from computer to computer | Excel Discussion (Misc queries) | |||
Display size difference- PC computer vs. Mac computer? | Excel Discussion (Misc queries) | |||
How do I copy all Excel files from old computer to new computer? | Excel Discussion (Misc queries) | |||
Autocomplete works with my home computer but not the office computer | Excel Discussion (Misc queries) |