Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 46
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,510
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 46
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
excel 2007 will not print to my default printer fwm Excel Discussion (Misc queries) 2 November 17th 09 02:33 AM
store default printer, change printer and then restore default printer? Dennis Pedersen Excel Programming 0 November 14th 07 09:18 PM
members on my network printer not able to print to default printer smeheut Excel Discussion (Misc queries) 0 June 18th 07 06:42 PM
default printer print quality list Gene Mills Excel Programming 0 March 7th 06 11:52 PM
how do i get excel to default print to fastdraft on my HP Printer Bigtalker Excel Discussion (Misc queries) 0 July 18th 05 10:02 PM


All times are GMT +1. The time now is 07:36 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"