Bonjour le forum
Bonjour Yves & mDF
Cette macro liste les imprimantes, donne le choix et le nombre de pages à
imprimer. Je ne l'ai pas testée.
Sub Imprime()
Dim BookName As sting
BookName = Workbooks("Machin.xls")
If Not Printer_Choice(BookName) Then Workbooks(BookName).Sheet(1).PrintOut
copies:=1
End Sub
'Sélection imprimante pour impression
Function Printer_Choice(nBook As String) As Boolean
Const msgPart1 = " page(s) à imprimer sur "
Const msgPart2 = "Imprimante active :"
Const msgPart3 = "Voulez-vous changer d'imprimante ?"
Dim Reply As Byte, Actual_Printer As String, nbPages As String
If Not nBook = "" Then
Workbooks(nBook).Activate
nbPages = ExecuteExcel4Macro("GET.DOCUMENT(50)") & msgPart1
End If
Actual_Printer = Application.ActivePrinter
Reply = MsgBox(nbPages & msgPart2 & vbLf & Actual_Printer & " !" & vbLf & vbLf & msgPart3 _
, 3 + 32 + 256, "Info utilisateur")
If Reply = vbYes Then Application.Dialogs(xlDialogPrinterSetup).Show
If Reply = vbCancel Then Printer_Choice = True
End Function
"De Michel Pierron"
@ ++ Eric C