ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Choose Printer other than default (https://www.excelbanter.com/excel-programming/377491-choose-printer-other-than-default.html)

ricowyder

Choose Printer other than default
 
Thanks for all of your previous help.

I have a short question. Wrote this sub and it's working fine. Though,
it's using default printer. Any chance that I can offer a list of
installed printers to choose from? Thanks for your answer.

Regards,

Rico

Sub PrintSheets()

ThisWorkbook.Worksheets("Name01").PrintOut Copies:=1, Collate:=True
ThisWorkbook.Worksheets("Name02").PrintOut Copies:=1, Collate:=True

End Sub


papou

Choose Printer other than default
 
Hello Rico
If Application.Dialogs(xlDialogPrinterSetup).Show < False Then
PrinterSelected = Application.ActivePrinter
With ThisWorkbook
..Worksheets("Name01").PrintOut Copies:=1, ActivePrinter:=PrinterSelected,
Collate:=True
..Worksheets("Name02").PrintOut Copies:=1, ActivePrinter:=PrinterSelected,
Collate:=True
End With
Else: MsgBox "Printer selection has been Cancelled", vbInformation,
"Cancelled"
End If

HTH
Cordially
Pascal

"ricowyder" a écrit dans le message de news:
...
Thanks for all of your previous help.

I have a short question. Wrote this sub and it's working fine. Though,
it's using default printer. Any chance that I can offer a list of
installed printers to choose from? Thanks for your answer.

Regards,

Rico

Sub PrintSheets()

ThisWorkbook.Worksheets("Name01").PrintOut Copies:=1, Collate:=True
ThisWorkbook.Worksheets("Name02").PrintOut Copies:=1, Collate:=True

End Sub




JMay

Choose Printer other than default
 
Papou,
Does the 1st line (below) say.. If the PrinterSetup Dialog Box is
Currently "On-Screen" (showing) - Whatever Printer is currently Selected
or Highlighted will be used in the printing of Worksheets Name01 and
Name02?

Thanks in advance,

If Application.Dialogs(xlDialogPrinterSetup).Show < False Then
PrinterSelected = Application.ActivePrinter

"papou" wrote in message
:

Hello Rico
If Application.Dialogs(xlDialogPrinterSetup).Show < False Then
PrinterSelected = Application.ActivePrinter
With ThisWorkbook
.Worksheets("Name01").PrintOut Copies:=1, ActivePrinter:=PrinterSelected,
Collate:=True
.Worksheets("Name02").PrintOut Copies:=1, ActivePrinter:=PrinterSelected,
Collate:=True
End With
Else: MsgBox "Printer selection has been Cancelled", vbInformation,
"Cancelled"
End If

HTH
Cordially
Pascal

"ricowyder" a écrit dans le message de news:
...
Thanks for all of your previous help.

I have a short question. Wrote this sub and it's working fine. Though,
it's using default printer. Any chance that I can offer a list of
installed printers to choose from? Thanks for your answer.

Regards,

Rico

Sub PrintSheets()

ThisWorkbook.Worksheets("Name01").PrintOut Copies:=1, Collate:=True
ThisWorkbook.Worksheets("Name02").PrintOut Copies:=1, Collate:=True

End Sub



papou

Choose Printer other than default
 
No, this only tests if no selection has been made from the list (cancelled
button clicked), in which case it will return False.

HTH
Cordially
Pascal

"JMay" a écrit dans le message de news:
...
Papou,
Does the 1st line (below) say.. If the PrinterSetup Dialog Box is
Currently "On-Screen" (showing) - Whatever Printer is currently Selected
or Highlighted will be used in the printing of Worksheets Name01 and
Name02?

Thanks in advance,

If Application.Dialogs(xlDialogPrinterSetup).Show < False Then
PrinterSelected = Application.ActivePrinter

"papou" wrote in message
:

Hello Rico
If Application.Dialogs(xlDialogPrinterSetup).Show < False Then
PrinterSelected = Application.ActivePrinter
With ThisWorkbook
.Worksheets("Name01").PrintOut Copies:=1, ActivePrinter:=PrinterSelected,
Collate:=True
.Worksheets("Name02").PrintOut Copies:=1, ActivePrinter:=PrinterSelected,
Collate:=True
End With
Else: MsgBox "Printer selection has been Cancelled", vbInformation,
"Cancelled"
End If

HTH
Cordially
Pascal

"ricowyder" a écrit dans le message de news:
...
Thanks for all of your previous help.

I have a short question. Wrote this sub and it's working fine. Though,
it's using default printer. Any chance that I can offer a list of
installed printers to choose from? Thanks for your answer.

Regards,

Rico

Sub PrintSheets()

ThisWorkbook.Worksheets("Name01").PrintOut Copies:=1, Collate:=True
ThisWorkbook.Worksheets("Name02").PrintOut Copies:=1, Collate:=True

End Sub





JMay

Choose Printer other than default
 
Papou, Could I ask you one more q ?

I'm seriousy trying to understand code so here's my problem in reading
the below 2 lines:

As I read it I understand it to say:

First I see the .Show method which (in the User Form environment) says
SHOW the form,, So I see If the Dialogbox Printer Setup.Show = TRUE
(< False)
Then Whatever the Current Active Printer IS assign it to the Variable
PrinterSelected.

Thanks in Advance;



If Application.Dialogs(xlDialogPrinterSetup).Show < False Then
PrinterSelected = Application.ActivePrinter

"papou" wrote in message
:

No, this only tests if no selection has been made from the list (cancelled
button clicked), in which case it will return False.

HTH
Cordially
Pascal

"JMay" a écrit dans le message de news:
...
Papou,
Does the 1st line (below) say.. If the PrinterSetup Dialog Box is
Currently "On-Screen" (showing) - Whatever Printer is currently Selected
or Highlighted will be used in the printing of Worksheets Name01 and
Name02?

Thanks in advance,

If Application.Dialogs(xlDialogPrinterSetup).Show < False Then
PrinterSelected = Application.ActivePrinter

"papou" wrote in message
:

Hello Rico
If Application.Dialogs(xlDialogPrinterSetup).Show < False Then
PrinterSelected = Application.ActivePrinter
With ThisWorkbook
.Worksheets("Name01").PrintOut Copies:=1, ActivePrinter:=PrinterSelected,
Collate:=True
.Worksheets("Name02").PrintOut Copies:=1, ActivePrinter:=PrinterSelected,
Collate:=True
End With
Else: MsgBox "Printer selection has been Cancelled", vbInformation,
"Cancelled"
End If

HTH
Cordially
Pascal

"ricowyder" a écrit dans le message de news:
...
Thanks for all of your previous help.

I have a short question. Wrote this sub and it's working fine. Though,
it's using default printer. Any chance that I can offer a list of
installed printers to choose from? Thanks for your answer.

Regards,

Rico

Sub PrintSheets()

ThisWorkbook.Worksheets("Name01").PrintOut Copies:=1, Collate:=True
ThisWorkbook.Worksheets("Name02").PrintOut Copies:=1, Collate:=True

End Sub





All times are GMT +1. The time now is 05:29 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com