XL 2013 Enregistrement d'un Userform en PDF

  • Initiateur de la discussion Initiateur de la discussion fruggiero
  • Date de début Date de début

Boostez vos compétences Excel avec notre communauté !

Rejoignez Excel Downloads, le rendez-vous des passionnés où l'entraide fait la force. Apprenez, échangez, progressez – et tout ça gratuitement ! 👉 Inscrivez-vous maintenant !

fruggiero

XLDnaute Nouveau
Bonjours a tout le monde !
Dans le cadre d'un projet a l'école, je doit faire un genre de formulaire sur un Userform et l'imprimer en PDF.
Voilà je me casse la tête depuis une petite semaine pour enregistré mon userForm en PDF. Mais il enregistre ma feuille au lieu de mon UserForm ...
Si vous vous avez une solution je prends 🙂

voici le code:

Dim pdfName As String

Application.ScreenUpdating = False

keybd_event VK_LMENU, 0, KEYEVENTF_EXTENDEDKEY, 0
keybd_event VK_SNAPSHOT, 0, KEYEVENTF_EXTENDEDKEY, 0
keybd_event VK_SNAPSHOT, 0, KEYEVENTF_EXTENDEDKEY + KEYEVENTF_KEYUP, 0
keybd_event VK_LMENU, 0, KEYEVENTF_EXTENDEDKEY + KEYEVENTF_KEYUP, 0

DoEvents

With ActiveSheet.PageSetup
.LeftMargin = Application.InchesToPoints(0.2)
.RightMargin = Application.InchesToPoints(0.2)
.TopMargin = Application.InchesToPoints(0.236)
.BottomMargin = Application.InchesToPoints(0.236)
.Orientation = xlLandscape
.CenterHorizontally = True
.CenterVertically = True
End With

pdfName = ActiveWorkbook.Path & "\Test_de_Conformité.pdf"

ActiveSheet.ExportAsFixedFormat
Type:=xlTypePDF,
Filename:=pdfName,
Quality:=xlQualityStandard,
IncludeDocProperties:=False,
IgnorePrintAreas:=False,
OpenAfterPublish:=True

Application.DisplayAlerts = False
Worksheets(Worksheets.Count).Delete
'Application.SendKeys "{ENTER}"
Unload Me
Application.DisplayAlerts = True
Application.ScreenUpdating = True
 

Pièces jointes

Dernière édition:
- Navigue sans publicité
- Accède à Cléa, notre assistante IA experte Excel... et pas que...
- Profite de fonctionnalités exclusives
Ton soutien permet à Excel Downloads de rester 100% gratuit et de continuer à rassembler les passionnés d'Excel.
Je deviens Supporter XLD

Discussions similaires

Réponses
7
Affichages
163
Retour