Erreur d'exécution 1004

Patient_M - 2 août 2023 à 09:28
cs_Le Pivert Messages postés 7903 Date d'inscription jeudi 13 septembre 2007 Statut Contributeur Dernière intervention 11 mars 2024 - 2 août 2023 à 12:25

Bonjour,

J'ai une ligne de code VBA pour convertir une feuille en PDF qui marchait bien, mais du coup ça commence à refuser et j'ignore la cause.

La voici :

Thisworkbook.Sheets("Rapport").ExportAsFixedFormat xlTypePDF, ThisWorkbook.path & Application.PathSeparator & "Paie du" & ".pdf"

Le message d'erreur est 1004

 : Document non enregistré


Android / Chrome 92.0.4515.131

1 réponse

cs_Le Pivert Messages postés 7903 Date d'inscription jeudi 13 septembre 2007 Statut Contributeur Dernière intervention 11 mars 2024 728
2 août 2023 à 12:25

Bonjour,

essaie ceci:

 ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
        ThisWorkbook.Path & "\Paie du.pdf", Quality:=xlQualityStandard, _
        IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:= _
        True

0