Imprimer 5 pdf en un click

Résolu/Fermé
Fullreyny - 23 sept. 2015 à 10:03
 Fullreyny - 23 sept. 2015 à 11:20
Bonjour le Forum.
Une question pas forcément simple (A commencer par l'exprimer) :-)
Je cherche à exécuter une macro qui :

1 - valide "enregistrer" sur la fenêtre de PDFCreator 1.5.1
2 - sélectionne le chemin de "enregistrer sous..." (pour moi : "R:\Documentation\PU_PCT\Listes de Préco\Edition_pdf\dépot")
3 - colle une information (copier au préalable) pour le "Nom du fichier :"
4 - enregistrer

le but étant de d'imprimer un document en 5 langues (1 doc par langue) en un seul click.

actuellement je réalise la macro suivant :

Sub TTLangue()
'
' TTLangue
'

'
Range("AB3").Select
ActiveCell.FormulaR1C1 = "FR"
Range("O13").Select
ExecuteExcel4Macro "PRINT(1,,,1,,,,,,,,2,""PDFCreator sur Ne00:"",,TRUE,,FALSE)"
Range("AD10").Select
Application.CutCopyMode = False
Selection.Copy
yourmsgbox = MsgBox("Voulez vous continuer sur la langue suivante", vbOKCancel, "Confirmation")

If yourmsgbox = vbCancel Then
Exit Sub
End If
Range("AB3").Select
ActiveCell.FormulaR1C1 = "EN"
Range("O13").Select
ExecuteExcel4Macro "PRINT(1,,,1,,,,,,,,2,""PDFCreator sur Ne00:"",,TRUE,,FALSE)"
Range("AD10").Select
Application.CutCopyMode = False
Selection.Copy
yourmsgbox = MsgBox("Voulez vous continuer sur la langue suivante", vbOKCancel, "Confirmation")

If yourmsgbox = vbCancel Then
Exit Sub
End If
Range("AB3").Select
ActiveCell.FormulaR1C1 = "DE"
Range("O13").Select
ExecuteExcel4Macro "PRINT(1,,,1,,,,,,,,2,""PDFCreator sur Ne00:"",,TRUE,,FALSE)"
Range("AD10").Select
Application.CutCopyMode = False
Selection.Copy
yourmsgbox = MsgBox("Voulez vous continuer sur la langue suivante", vbOKCancel, "Confirmation")

If yourmsgbox = vbCancel Then
Exit Sub
End If
Range("AB3").Select
ActiveCell.FormulaR1C1 = "ES"
Range("O13").Select
ExecuteExcel4Macro "PRINT(1,,,1,,,,,,,,2,""PDFCreator sur Ne00:"",,TRUE,,FALSE)"
Range("AD10").Select
Application.CutCopyMode = False
Selection.Copy
yourmsgbox = MsgBox("Voulez vous continuer sur la langue suivante", vbOKCancel, "Confirmation")

If yourmsgbox = vbCancel Then
Exit Sub
End If
Range("AB3").Select
ActiveCell.FormulaR1C1 = "IT"
Range("O13").Select
ExecuteExcel4Macro "PRINT(1,,,1,,,,,,,,2,""PDFCreator sur Ne00:"",,TRUE,,FALSE)"
Range("AD10").Select
Application.CutCopyMode = False
Selection.Copy
Range("A1").Select
End Sub

J'ai mis un Msgbox pour empêcher la macro de dérouler sinon je ne peux pas les nommer correctement.
Seulement je me retrouve à effectuer les action pdf à la mano.
Donc si à la place du msgbox je pouvais avoir les demandes (1, 2, 3, 4) ce serait le top.

Si un génie de la macro sait me répondre, je lui en serait extrêmement reconnaissant.

Merci à toute personne apportant une aide.
Cdlt
A voir également:

1 réponse

Bon bah finalement j'ai trouvé.
ça donne ça

Sub TTLangue()
'
' TTLangue
'

'
Range("AB3").Select
ActiveCell.FormulaR1C1 = "FR"
Range("O13").Select
Chemin = "R:\Documentation\PU_PCT\Listes de Préco\Edition_pdf\dépot\"
Texte = Range("AD10")
Application.DisplayAlerts = False
ActiveSheet.ExportAsFixedFormat Type:=x1TypePDF, _
Filename:=Chemin & Texte, _
Quality:=x1QualityMinimum, _
IncludeDocProperties:=True, _
IgnorePrintAreas:=False, _
OpenAfterPublish:=False
Range("AB3").Select
ActiveCell.FormulaR1C1 = "EN"
Range("O13").Select
Chemin = "R:\Documentation\PU_PCT\Listes de Préco\Edition_pdf\dépot\"
Texte = Range("AD10")
Application.DisplayAlerts = False
ActiveSheet.ExportAsFixedFormat Type:=x1TypePDF, _
Filename:=Chemin & Texte, _
Quality:=x1QualityMinimum, _
IncludeDocProperties:=True, _
IgnorePrintAreas:=False, _
OpenAfterPublish:=False
Range("AB3").Select
ActiveCell.FormulaR1C1 = "DE"
Range("O13").Select
Chemin = "R:\Documentation\PU_PCT\Listes de Préco\Edition_pdf\dépot\"
Texte = Range("AD10")
Application.DisplayAlerts = False
ActiveSheet.ExportAsFixedFormat Type:=x1TypePDF, _
Filename:=Chemin & Texte, _
Quality:=x1QualityMinimum, _
IncludeDocProperties:=True, _
IgnorePrintAreas:=False, _
OpenAfterPublish:=False
Range("AB3").Select
ActiveCell.FormulaR1C1 = "ES"
Range("O13").Select
Chemin = "R:\Documentation\PU_PCT\Listes de Préco\Edition_pdf\dépot\"
Texte = Range("AD10")
Application.DisplayAlerts = False
ActiveSheet.ExportAsFixedFormat Type:=x1TypePDF, _
Filename:=Chemin & Texte, _
Quality:=x1QualityMinimum, _
IncludeDocProperties:=True, _
IgnorePrintAreas:=False, _
OpenAfterPublish:=False
Range("AB3").Select
ActiveCell.FormulaR1C1 = "IT"
Range("O13").Select
Chemin = "R:\Documentation\PU_PCT\Listes de Préco\Edition_pdf\dépot\"
Texte = Range("AD10")
Application.DisplayAlerts = False
ActiveSheet.ExportAsFixedFormat Type:=x1TypePDF, _
Filename:=Chemin & Texte, _
Quality:=x1QualityMinimum, _
IncludeDocProperties:=True, _
IgnorePrintAreas:=False, _
OpenAfterPublish:=False
Range("A1").Select
End Sub
0