Forum Discussion
JoeyS-1701
Jan 20, 2021Copper Contributor
VBA creates PDF attachment & saves but does not generate the email and attach
Hello, I have used the following VBA to create a PDF attachment and email to a group of recipients. It is creating the PDF in the same folder as where the Excel file is but it does not create ...
HansVogelaar
Jan 20, 2021MVP
Cell P20 should contain the path and filename. The code will add the sheet name to it, plus the extension .pdf.
If P20 does not contain the path, you should add it in the code:
PdfFile = ThisWorkbook.Path & "\" & Title
I'd - at least temporarily - change .Send to .Display
Outlook should then display the email message for you to inspect. You can click Send manually.
JoeyS-1701
Jan 20, 2021Copper Contributor
Thank you. That does generate an email that is displayed, with the PDF attached, for review and can be sent. Much appreciated.