Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

Format PDF

2 réponses
Avatar
Guy72
Bonjour,
Peut-on enregistrer un fichier Excel sous format PDF ?
Merci de votre aide
--
Cordialement
Guy

2 réponses

Avatar
Daniel.C
Bonjour.
Si tu as Office 2007 SP2, oui, de façon native (Enregistrer sous,
format pdf). Néanmoins des pb sont signalés avec les graphiques ou les
formes.
Sinon, utilise des émulateurs d'imprimante comme PDFCreator.
Cordialement.
Daniel

Bonjour,
Peut-on enregistrer un fichier Excel sous format PDF ?
Merci de votre aide


Avatar
Guy72
Bonjour,
Merci de vos réponses
--
Cordialement
Guy

"isabelle" a écrit dans le message de news:

bonjour Guy,

si tu as installer PDFCreator, voici un exemple trouver sur :

'http://www.excel-downloads.com/forum/112586-edition-pdf.html Autheur:
GGAL

Sub printtest_1()
'La feuille active.
a = ActiveSheet.Name
Call printsheetinpdf(Sheets(a))
End Sub

Sub printtest_2()
'Quelques feuilles du classeur, à adapter.
a = ActiveSheet.Name
b = "Annexe"
c = Sheets(3)
Call printsheetinpdf(Sheets(Array(a, b, c)))
End Sub

Sub printtest_3()
'Le classeur entier.
Call printsheetinpdf(ActiveWorkbook)
End Sub

Sub printsheetinpdf(shsheet As Object)
Dim pdfjob As Object
Dim spdfname As String
Dim spdfpath As String
spdfname = "Fiche navette_" & Range("h8") & "_" & Format(Date,
"dd-mm-yyyy") & ".pdf" 'Nom du fichier, à adapter
spdfpath = "c:zz" 'Documents and Settings" &
UCase(Environ("username")) & "Mes documents" 'Nom du chemin, à adapter
Call killtask("PDFCreator.exe")
Set pdfjob = CreateObject("PDFCreator.clsPDFCreator")
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") = spdfpath
.cOption("AutosaveFilename") = spdfname
.cOption("AutosaveFormat") = 0
.cClearCache
End With
shsheet.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
Application.Wait (Now + TimeValue("0:00:3"))
.cClose
End With
Set pdfjob = Nothing
End Sub

Sub killtask(sappname As String)
Dim oProclist As Object
Dim oWMI As Object
Dim oProc As Object
Set oWMI = GetObject("winmgmts:")
If IsNull(oWMI) = False Then
Set oProclist = oWMI.InstancesOf("win32_process")
For Each oProc In oProclist
If UCase(oProc.Name) = UCase(sappname) Then
oProc.Terminate (0)
End If
Next oProc
Else
MsgBox "Killing """ & sappname & """ - Can't create WMI Object.",
vbOKOnly, vbCritical, "CloseAPP_B"
End If
Set oProclist = Nothing
Set oWMI = Nothing
End Sub

isabelle

Guy72 a écrit :
Bonjour,
Peut-on enregistrer un fichier Excel sous format PDF ?
Merci de votre aide