Je possède deux feuilles comprenant chacune un TCD que je souhaite sauvegarder en PDF à chaque clic sur un bouton de commande.
Ma macro plante "erreur d'execution" erreur automation la syntaxe du nom de fichier, de répertoire ou de volume est incorrecte" (la ligne en rouge ci-dessous est celle qui est en jaune dans le débogage)
voici ma macro :
Code:
Sub Archivage()
ChemindAcces = ThisWorkbook.Path & ":SOFF_"
With Worksheets("ENTRANTS")
NomClient = .Range("AL1") & "_entrants" & ".pdf"
.ExportAsFixedFormat Type:=xlTypePDF, Filename:=ChemindAcces & NomClient
End With
With Worksheets("SORTANTS")
NomClient = .Range("AL1") & "_sortants" & ".pdf"
.ExportAsFixedFormat Type:=xlTypePDF, Filename:=ChemindAcces & NomClient
End With
End Sub
Je possède deux feuilles comprenant chacune un TCD que je souhaite sauvegarder en PDF à chaque clic sur un bouton de commande.
Ma macro plante "erreur d'execution" erreur automation la syntaxe du nom de fichier, de répertoire ou de volume est incorrecte" (la ligne en rouge ci-dessous est celle qui est en jaune dans le débogage)
voici ma macro :
Code:
Sub Archivage()
ChemindAcces = ThisWorkbook.Path & ":SOFF_"
With Worksheets("ENTRANTS")
NomClient = .Range("AL1") & "_entrants" & ".pdf"
.ExportAsFixedFormat Type:=xlTypePDF, Filename:=ChemindAcces & NomClient
End With
With Worksheets("SORTANTS")
NomClient = .Range("AL1") & "_sortants" & ".pdf"
.ExportAsFixedFormat Type:=xlTypePDF, Filename:=ChemindAcces & NomClient
End With
End Sub