nyeri
Messages postés45Date d'inscriptionvendredi 2 novembre 2007StatutMembreDernière intervention29 février 2012
-
24 févr. 2012 à 10:03
nyeri
Messages postés45Date d'inscriptionvendredi 2 novembre 2007StatutMembreDernière intervention29 février 2012
-
24 févr. 2012 à 12:48
Bonjour,
Je vous expose mon problème.
J'ai un fichier excel qui me génère des feuilles automatique ou on y place des tableau et des graphiques. A la fin de la génération de ces documents je souhaite récupérer dans un fichier PDF toutes mes feuilles créé. Pour convertir mes feuilles excel en PDF j'utilise cette fonction qui marche très bien :
Sub ToPdf()
Set pdfjob = CreateObject("PDFCreator.clsPDFCreator")
NomExcel = ThisWorkbook.Name
NomPdf = Left(NomExcel, Len(NomExcel) - 4) & ".pdf"
With pdfjob
If .cstart("/NoProcessingAtStartup") = False Then
MsgBox "Can't initialize PDFCreator.", vbCritical + vbOKOnly, "PrtPDFCreator"
Exit Sub
End If
.cOption("UseAutosave") = 1
.cOption("UseAutisaveDirectory") = 1
.cOption("AutosaveDirectory") = ThisWorkbook.Path
.cOption("AutosaveFilename") = NomPdf
.cOption("AutosaveFormat") = 0
.cClearCache
End With
ThisWorkbook.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
Set pdfjob = Nothing
End Sub
Le problème que j'ai c'est que mes feuilles Excel sont trop large pour tenir sur une page PDF. Voir photo01
Voila quelqu’un pourrait il m'aider à palier ce problème, car je veut absolument afficher une feuille excel par page. Je suis ouvert à toute proposition.