Bonjour,
Tout d'abord merci pour vos ressources qui m'ont bien aidé.
Il me reste néanmoins un mystère que je n'arrive pas a résoudre.
Dans le code ci-joint le fichier PDF se créer dans le dossier microsoft/data/Document au lieu de se créer dans le dossier racine du classeur Excel
La boite de dialogue a la fin d'exécution renvoi pourtant bien le chemin d'accès du fichier Excel avec l'argument ActiveWorkbook.Path j'ai également essayer avec ThisWorkBook.path
Auriez vous une piste ?
merci d'avance
Sub Impression_Convocation()
Dim PDFFullName As String
Dim WBPath As String
Dim Dot As Integer
Application.ScreenUpdating = False
For Dot = 1 To 12 Step 1
WBPath = ActiveWorkbook.Path
Sheets("Convocation").Range("B8").Value = Sheets("Convocation").Cells(Dot, 1).Value
PDFFullName = Sheets("Convocation").Cells(8, 2) & " - Convocation - " & Sheets("Convocation").Cells(19, 13) & ".pdf"
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, _
FileName:=PDFFullName, _
Quality:=xlQualityStandard, _
IncludeDocProperties:=True, _
IgnorePrintAreas:=False, _
OpenAfterPublish:=False
Next Dot
MsgBox "Fichier """ & "Document généré dans le dossier " & ActiveWorkbook.Path & """ enregistré !"
End Sub
Tout d'abord merci pour vos ressources qui m'ont bien aidé.
Il me reste néanmoins un mystère que je n'arrive pas a résoudre.
Dans le code ci-joint le fichier PDF se créer dans le dossier microsoft/data/Document au lieu de se créer dans le dossier racine du classeur Excel
La boite de dialogue a la fin d'exécution renvoi pourtant bien le chemin d'accès du fichier Excel avec l'argument ActiveWorkbook.Path j'ai également essayer avec ThisWorkBook.path
Auriez vous une piste ?
merci d'avance
Sub Impression_Convocation()
Dim PDFFullName As String
Dim WBPath As String
Dim Dot As Integer
Application.ScreenUpdating = False
For Dot = 1 To 12 Step 1
WBPath = ActiveWorkbook.Path
Sheets("Convocation").Range("B8").Value = Sheets("Convocation").Cells(Dot, 1).Value
PDFFullName = Sheets("Convocation").Cells(8, 2) & " - Convocation - " & Sheets("Convocation").Cells(19, 13) & ".pdf"
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, _
FileName:=PDFFullName, _
Quality:=xlQualityStandard, _
IncludeDocProperties:=True, _
IgnorePrintAreas:=False, _
OpenAfterPublish:=False
Next Dot
MsgBox "Fichier """ & "Document généré dans le dossier " & ActiveWorkbook.Path & """ enregistré !"
End Sub
Dernière édition: