PDA

View Full Version : [SOLVED] xldialogprintersetup Problem



gschwint
12-28-2004, 11:11 AM
I have the following code that displays the xldialogprintersetup window and makes the cancel button function correctly, however the setup button still does not function correctly. It displays the settings for the default printer not the printer chosen. Any help?

Thanks



Sub Select_Printer()
Dim Test As String
Dim CPrinter As String
Dim ws As Worksheet
Do Until CPrinter = Application.ActivePrinter
CPrinter = Application.ActivePrinter
Application.StatusBar = "Printer " & CPrinter & " Selected"
Test = Application.Dialogs(xlDialogPrinterSetup).Show
If Test = "False" Then
Application.StatusBar = ""
Exit Sub
End If
Loop
If Test = "True" Then
Sheets("Manure Source Info").Printout
Sheets("Field Info").Printout
Sheets("Sensitive Areas Management").Printout
Sheets("High P Soil Management").Printout
Sheets("Field Specific Land Application").Printout
Response = MsgBox("To complete your Manure Management Plan please attach aerial photgraphs or maps the identify the fields scheduled to receive manure. These aerial photographs or maps should identify all sensitive features within each field. Also please attach a copy of the most recent manure nutrient analysis and all soil test data.")
End If
End Sub

Jacob Hilderbrand
12-29-2004, 01:25 AM
That's the way the dialog works. You can change the active printer.

Application.ActivePrinter = "Printer Name"