Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
I have 6 users who print out a contract from Excel. This is using our color printer (HP Color LaserJet P_30), which I can get to work with no problem. The problem I am running into, is my macro that prints this contract opens a word document and prints that as well. The issue is, some of my users print on "HP Color LaserJet P_30 on ne01" and some print on "HP Color LaserJet P_30 on ne02". How can I make the word doc print to this color printer . My code is below. Any help is appreciated. Sub Finalize() ' ' Finalize Macro ' Macro recorded 12/22/2004 by Psion Teklogix ' ' Sheets("Agreement").Cells(8, 12).Value = InputBox("Please Enter Contract #", "Contract #", Sheets("Agreement").Cells(8, 12).Value) On Error Resume Next Application.ActivePrinter = "HP Color LaserJet P_30 on Ne01:" If Err.Number = 1004 Then Application.ActivePrinter = "HP Color LaserJet P_30 on Ne02:" Err.Clear End If Application.ScreenUpdating = False Sheets("Letter").Select ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True Sheets("Cover").Select ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True Sheets("Agreement").Select ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True Dim WD As Object Set WD = CreateObject("Word.Application") WD.Documents.Open ("G:\CONTRACT\Contract Terms\macro\2005 t&cscontract.doc") WD.ActivePrinter = "HP Color LaserJet P_30:" WD.ActiveDocument.PrintOut Background:=False WD.Application.Quit SaveChanges:=wdDoNotSaveChanges Set WD = Nothing Sheets("Agreement").Select ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True Sheets("Cover").Select ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True Sheets("Agreement").Select ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True Application.ScreenUpdating = True End Sub |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I resolved it.
WD.ActivePrinter = Application.ActivePrinter "Brad" wrote: Hello, I have 6 users who print out a contract from Excel. This is using our color printer (HP Color LaserJet P_30), which I can get to work with no problem. The problem I am running into, is my macro that prints this contract opens a word document and prints that as well. The issue is, some of my users print on "HP Color LaserJet P_30 on ne01" and some print on "HP Color LaserJet P_30 on ne02". How can I make the word doc print to this color printer . My code is below. Any help is appreciated. Sub Finalize() ' ' Finalize Macro ' Macro recorded 12/22/2004 by Psion Teklogix ' ' Sheets("Agreement").Cells(8, 12).Value = InputBox("Please Enter Contract #", "Contract #", Sheets("Agreement").Cells(8, 12).Value) On Error Resume Next Application.ActivePrinter = "HP Color LaserJet P_30 on Ne01:" If Err.Number = 1004 Then Application.ActivePrinter = "HP Color LaserJet P_30 on Ne02:" Err.Clear End If Application.ScreenUpdating = False Sheets("Letter").Select ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True Sheets("Cover").Select ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True Sheets("Agreement").Select ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True Dim WD As Object Set WD = CreateObject("Word.Application") WD.Documents.Open ("G:\CONTRACT\Contract Terms\macro\2005 t&cscontract.doc") WD.ActivePrinter = "HP Color LaserJet P_30:" WD.ActiveDocument.PrintOut Background:=False WD.Application.Quit SaveChanges:=wdDoNotSaveChanges Set WD = Nothing Sheets("Agreement").Select ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True Sheets("Cover").Select ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True Sheets("Agreement").Select ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True Application.ScreenUpdating = True End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Problems printing | New Users to Excel | |||
printing problems | Excel Worksheet Functions | |||
Help with printing problems? | Excel Discussion (Misc queries) | |||
Printing Problems | Excel Programming | |||
Printing problems | Excel Programming |