Enregistrer sous avec nom du document VBA
Résolu/Fermé
NeOXi-_Alpha
Messages postés
65
Date d'inscription
mardi 13 novembre 2018
Statut
Membre
Dernière intervention
31 mai 2019
-
8 févr. 2019 à 14:39
NeOXi-_Alpha Messages postés 65 Date d'inscription mardi 13 novembre 2018 Statut Membre Dernière intervention 31 mai 2019 - 20 mars 2019 à 11:36
NeOXi-_Alpha Messages postés 65 Date d'inscription mardi 13 novembre 2018 Statut Membre Dernière intervention 31 mai 2019 - 20 mars 2019 à 11:36
A voir également:
- Application.getsaveasfilename pdf
- Annuaire portable gratuit a partir d'un nom ✓ - Forum Mobile
- Nom de l'adresse ✓ - Forum Internet / Réseaux sociaux
- Enregistrer video youtube - Guide
- Enregistrer son ecran - Guide
- Erreur 1004 vba ✓ - Forum VB / VBA
1 réponse
cs_Le Pivert
Messages postés
7883
Date d'inscription
jeudi 13 septembre 2007
Statut
Contributeur
Dernière intervention
18 mars 2023
724
8 févr. 2019 à 15:12
8 févr. 2019 à 15:12
Bonjour,
Voir cet exemple à adapter pour un PDF:
https://forums.commentcamarche.net/forum/affich-35827383-creation-d-onglets-par-jour#35
Voir cet exemple à adapter pour un PDF:
https://forums.commentcamarche.net/forum/affich-35827383-creation-d-onglets-par-jour#35
5 mars 2019 à 13:46
Sub Enregistrer_PDF() Dim fileSaveName As String Dim nom As String Dim chemin As String nom = [K16] chemin = [K14] If Len(Dir(chemin, vbDirectory)) > 0 Then If [D93] = "" Then Range("D1:G81").Select fileSaveName = Application.GetSaveAsFilename(chemin & "\" & nom, "Fichier PDF (*.pdf), *.pdf") Selection.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _ fileSaveName, Quality:=xlQualityStandard, _ IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:= _ False Else If [D174] = "" Then Range("D1:G162").Select fileSaveName = Application.GetSaveAsFilename(chemin & "\" & nom, "Fichier PDF (*.pdf), *.pdf") Selection.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _ fileSaveName, Quality:=xlQualityStandard, _ IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:= _ False Else If [D255] = "" Then Range("D1:G243").Select fileSaveName = Application.GetSaveAsFilename(chemin & "\" & nom, "Fichier PDF (*.pdf), *.pdf") Selection.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _ fileSaveName, Quality:=xlQualityStandard, _ IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:= _ False Else Range("D1:G324").Select fileSaveName = Application.GetSaveAsFilename(chemin & "\" & nom, "Fichier PDF (*.pdf), *.pdf") Selection.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _ fileSaveName, Quality:=xlQualityStandard, _ IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:= _ False End If End If End If MsgBox "Le Devis est enregistré dans " & chemin & " au nom de " & nom Else MsgBox "Le dossier de destination n'existe pas" End If End Sub@+ Le Pivert
Modifié le 20 mars 2019 à 11:25
voila se que j'ai fait depuis la dernier foi je n'avais pas eu le temps de m'y pencher plus tôt mais du-coup j'ai faire un truc qui rend exactement se que je cherche a faire sauf que je n'arrive pas à lui donné le nom voulue pouvez vous m'aidez.
voici mon code:
Range("D1:G85").Select ActiveSheet.PageSetup.PrintArea = "D1:G85" Selection.ExportAsFixedFormat Type:=xlTypePDF filesavename = Application.GetSaveAsFilename(, "PDF Files (*.pdf), *.pdf")20 mars 2019 à 11:36