Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
If no default printer Open Print Diablog box
currently I have this code. What keeps happening is that whenever
a user goes to a computer where their is no default printer, the print goes automatically to Save As dialog box. Is there a way to make it so that the Save As diablog box doesn't pop up. The Print Dialog box pops up instead so that users can choose which printer to print from. Can someone add those VBA for me?? If IsNumeric(Range("F65")) = True And Range("F65") 0 And _ Range("G59") = "SAN BRUNO CABLE TV" And _ Range("F64") < "SELECT USER" And _ WorksheetFunction.CountA(Range("C61"), _ Range("C62"), Range("F61"), Range("F62"), _ Range("I61"), Range("I62")) = 1 Then Range("A18:I69").PrintOut Copies:=1 End if |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
If no default printer Open Print Diablog box
The following is untested because I don't know how you can have no default
printer if printers are actually connected to the computer. However, it might point you in the right direction. You could use the following code to to find out what value (if any) is returned if no default printer. MsgBox Application.ActivePrinter Then use code similar to the following where I have just assumed that if no default printer it will return a zero length string. If Application.ActivePrinter = "" Then Application.Dialogs(xlDialogPrint).Show End If Also you can use the following and simply set the required printer before printing. Application.ActivePrinter = "Brother HL-1430 series on Ne02: Note that you need to properly identify the printer name with follwoing code when the printer has been set as the default printer for the computer. MsgBox Application.ActivePrinter -- Regards, OssieMac |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
If no default printer Open Print Diablog box
'This is exactly what I was looking for!
If Application.ActivePrinter = "" Then Application.ActivePrinter = "Brother HL-1430 series on Ne02: End if End sub 'Thank you OssieMac "--Gerard "OssieMac" wrote in message ... The following is untested because I don't know how you can have no default printer if printers are actually connected to the computer. However, it might point you in the right direction. You could use the following code to to find out what value (if any) is returned if no default printer. MsgBox Application.ActivePrinter Then use code similar to the following where I have just assumed that if no default printer it will return a zero length string. If Application.ActivePrinter = "" Then Application.Dialogs(xlDialogPrint).Show End If Also you can use the following and simply set the required printer before printing. Application.ActivePrinter = "Brother HL-1430 series on Ne02: Note that you need to properly identify the printer name with follwoing code when the printer has been set as the default printer for the computer. MsgBox Application.ActivePrinter -- Regards, OssieMac |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
excel 2007 will not print to my default printer | Excel Discussion (Misc queries) | |||
store default printer, change printer and then restore default printer? | Excel Programming | |||
members on my network printer not able to print to default printer | Excel Discussion (Misc queries) | |||
default printer print quality list | Excel Programming | |||
how do i get excel to default print to fastdraft on my HP Printer | Excel Discussion (Misc queries) |