Impression pdf creator
lebtibo33
-
cs_Le Pivert Messages postés 7904 Date d'inscription Statut Contributeur Dernière intervention -
cs_Le Pivert Messages postés 7904 Date d'inscription Statut Contributeur Dernière intervention -
Bonjour à tous,
j'ai créé un programme pour mon entreprise afin de créer des bons de livraison sous excel.
J'ai, dans ce programme, créé une macro pour imprimer avec pdf creator.
cette macro marchait très bien jusqu'à la dernière mise à jour de pdf creator.
Je ne trouve plus la référence PDF creator dans visual basic editor.
pour info je travail sur microsoft office 2010
et la nouvelle version de pdf creator est 2.0 avant celle là j'avais la 1.7
et donc j'ai un messge d'erreur : erreur d'execution 429
Un composant ActiveXne peut pas créer d'objet.
comment puis je faire?
voici mon code vba:
Public Sub Test1()
Dim pdfjob
Dim NomExcel, NomPdf, DefaultPrinter
Set pdfjob = CreateObject("PDFCreator.clsPDFCreator")
Dim Chemin As String, Fich As String, rep
Chemin = Workbooks(ActiveWorkbook.Name).Path & "\historique"
Fich = Range("B21").Value & ".pdf"
rep = Dir(Chemin & "\" & Fich)
If rep = "" Then
MsgBox "le fichier n'existe pas création du fichier PDFCreator"
Impression:
With pdfjob
If .cStart("/NoProcessingAtStartup") = False Then
MsgBox "Impossible d'initialiser PDFCreator.", vbCritical + vbOKOnly, "PrtPDFCreator"
Exit Sub
End If
.cOption("UseAutosave") = 1
.cOption("UseAutisaveDirectory") = 1
.cOption("AutosaveDirectory") = Chemin
.cOption("AutosaveFilename") = Fich
.cOption("AutosaveFormat") = 0
.cClearCache
End With
ThisWorkbook.Sheets("Feuil1").PrintOut Copies:=1, ActivePrinter:="PDFCreator"
Do Until pdfjob.cCountOfPrintjobs = 1
DoEvents
Loop
pdfjob.cPrinterStop = False
Do Until pdfjob.cCountOfPrintjobs = 0
DoEvents
Loop
With pdfjob
.cDefaultPrinter = DefaultPrinter
.cClearCache
.cClose
End With
Else
réponse = MsgBox("le fichier existe voulez-vous le remplacer ?", vbYesNo)
If réponse = vbYes Then
MsgBox "Remplacement du fichier existant"
GoTo Impression
Else
MsgBox "Sortie de la procédure"
Exit Sub
End If
End If
Range("M22").Select
ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:=Chemin & "\" & Fich _
, TextToDisplay:=" "
Range("M22").Select
Selection.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True
Range("A1").Select
Dim a As String
Dim b As String
a = Range("M17")
b = Range("E11")
Sheets("Feuil3").Select
Range("A65536").End(xlUp).Offset(1, 0) = b
Range("B65536").End(xlUp) = -a
End Sub
merci d'avance
j'ai créé un programme pour mon entreprise afin de créer des bons de livraison sous excel.
J'ai, dans ce programme, créé une macro pour imprimer avec pdf creator.
cette macro marchait très bien jusqu'à la dernière mise à jour de pdf creator.
Je ne trouve plus la référence PDF creator dans visual basic editor.
pour info je travail sur microsoft office 2010
et la nouvelle version de pdf creator est 2.0 avant celle là j'avais la 1.7
et donc j'ai un messge d'erreur : erreur d'execution 429
Un composant ActiveXne peut pas créer d'objet.
comment puis je faire?
voici mon code vba:
Public Sub Test1()
Dim pdfjob
Dim NomExcel, NomPdf, DefaultPrinter
Set pdfjob = CreateObject("PDFCreator.clsPDFCreator")
Dim Chemin As String, Fich As String, rep
Chemin = Workbooks(ActiveWorkbook.Name).Path & "\historique"
Fich = Range("B21").Value & ".pdf"
rep = Dir(Chemin & "\" & Fich)
If rep = "" Then
MsgBox "le fichier n'existe pas création du fichier PDFCreator"
Impression:
With pdfjob
If .cStart("/NoProcessingAtStartup") = False Then
MsgBox "Impossible d'initialiser PDFCreator.", vbCritical + vbOKOnly, "PrtPDFCreator"
Exit Sub
End If
.cOption("UseAutosave") = 1
.cOption("UseAutisaveDirectory") = 1
.cOption("AutosaveDirectory") = Chemin
.cOption("AutosaveFilename") = Fich
.cOption("AutosaveFormat") = 0
.cClearCache
End With
ThisWorkbook.Sheets("Feuil1").PrintOut Copies:=1, ActivePrinter:="PDFCreator"
Do Until pdfjob.cCountOfPrintjobs = 1
DoEvents
Loop
pdfjob.cPrinterStop = False
Do Until pdfjob.cCountOfPrintjobs = 0
DoEvents
Loop
With pdfjob
.cDefaultPrinter = DefaultPrinter
.cClearCache
.cClose
End With
Else
réponse = MsgBox("le fichier existe voulez-vous le remplacer ?", vbYesNo)
If réponse = vbYes Then
MsgBox "Remplacement du fichier existant"
GoTo Impression
Else
MsgBox "Sortie de la procédure"
Exit Sub
End If
End If
Range("M22").Select
ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:=Chemin & "\" & Fich _
, TextToDisplay:=" "
Range("M22").Select
Selection.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True
Range("A1").Select
Dim a As String
Dim b As String
a = Range("M17")
b = Range("E11")
Sheets("Feuil3").Select
Range("A65536").End(xlUp).Offset(1, 0) = b
Range("B65536").End(xlUp) = -a
End Sub
merci d'avance
A voir également:
- Impression pdf creator
- Spouleur d'impression - Guide
- Lire le coran en français pdf - Télécharger - Histoire & Religion
- Pdf creator - Télécharger - PDF
- Impression livret a5 - Guide
- Save as pdf office 2007 - Télécharger - Bureautique