Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 209
Default Choose a printer

hi!!

I use this
Range("print!a1:n71").PrintOut

And the range be printet thats ok
but how can i make it so i can choose a printer before printing

Best regards
Alvin

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 400
Default Choose a printer

If you know the name of the printer, you can set this property:

curPrinter= application.ActivePrinter
Application.ActivePrinter = <desired printer
....after printing, reset to original printer
application.ActivePrinter = curPrinter

If you don't know the name of the desired printer, you'd need to enumerate
the printers available(investigate the Windows EnumPrinters API) and offer
users a means of selecting the appropriate printer.

"Alvin Hansen" wrote:

hi!!

I use this
Range("print!a1:n71").PrintOut

And the range be printet thats ok
but how can i make it so i can choose a printer before printing

Best regards
Alvin

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 109
Default Choose a printer

Hi Alvin

Someting along these lines.

Sub ChoosePrinter()
'Leo Heuser 11-3-2005
Dim ActPrinter As String
Dim Answer As Boolean

With Application
ActPrinter = .ActivePrinter
Answer = .Dialogs(xlDialogPrinterSetup).Show
End With

If Answer = False Then
Exit Sub
Else
'Printout here
End If

Application.ActivePrinter = ActPrinter

End Sub

--
Best Regards
Leo Heuser

Followup to newsgroup only please.

"Alvin Hansen" skrev i en meddelelse
...
hi!!

I use this
Range("print!a1:n71").PrintOut

And the range be printet thats ok
but how can i make it so i can choose a printer before printing

Best regards
Alvin



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 209
Default Choose a printer

Thanks Leo

Its working

Regards Alvin


"Leo Heuser" skrev:

Hi Alvin

Someting along these lines.

Sub ChoosePrinter()
'Leo Heuser 11-3-2005
Dim ActPrinter As String
Dim Answer As Boolean

With Application
ActPrinter = .ActivePrinter
Answer = .Dialogs(xlDialogPrinterSetup).Show
End With

If Answer = False Then
Exit Sub
Else
'Printout here
End If

Application.ActivePrinter = ActPrinter

End Sub

--
Best Regards
Leo Heuser

Followup to newsgroup only please.

"Alvin Hansen" skrev i en meddelelse
...
hi!!

I use this
Range("print!a1:n71").PrintOut

And the range be printet thats ok
but how can i make it so i can choose a printer before printing

Best regards
Alvin




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 109
Default Choose a printer

You're welcome, Alvin.
Thanks for the feedback :-)

--
Best Regards
LeoH


"Alvin Hansen" skrev i en meddelelse
...
Thanks Leo

Its working

Regards Alvin



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
choose. pierre Excel Discussion (Misc queries) 2 April 25th 08 10:04 PM
choose? pierre Excel Discussion (Misc queries) 2 April 24th 08 09:47 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
Printer Multiple Worksheets with a particular Printer Setting PP[_2_] Excel Worksheet Functions 0 March 14th 07 02:02 PM
Help with macro to choose printer Wind54Surfer New Users to Excel 2 December 21st 04 12:09 AM


All times are GMT +1. The time now is 02:06 PM.

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

About Us

"It's about Microsoft Excel"