Show In some cases, you may need to send a worksheet as a PDF file through Outlook. Usually, you have to manually save the worksheet as a PDF file, then create a new email with this PDF file as attachment in your Outlook and finally send it. It is time-consuming to achieve it manually step by step. In this article, we will show you how to quickly save a worksheet as a PDF file and send it automatically as an attachment through Outlook in Excel. Save a worksheet as PDF file and email it as an attachment with VBA code Save a worksheet as PDF file and email it as an attachment with VBA codeYou can run the below VBA code to automatically save active worksheet as a PDF file, and then email it as an attachment through Outlook. Please do as follows. 1. Open the worksheet you will save as PDF and send, then press the Alt + F11 keys simultaneously to open the Microsoft Visual Basic for Applications window. 2. In the Microsoft Visual Basic for Applications window, click Insert > Module. Then copy and paste the below VBA code into the Code window. See screenshot: VBA code: Save a worksheet as PDF file and email it as an attachment
3. Press the F5 key to run the code. In the Browse dialog box, please select a folder to save this PDF file, and then click the OK button. Notes: 1. Now the active worksheet is saved as PDF file. And the PDF file is named with the worksheet name. 2. If the active worksheet is blank, you will get a dialog box as below screenshot shown after clicking the OK button. 4. Now a new Outlook email is created and you can see the PDF file is listed as an attachment in the Attached filed. See screenshot: 5. Please compose this email and then send it. 6. This code is only available when you use Outlook as your mail program. Related articles:
The Best Office Productivity ToolsKutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%
Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier
Comments (61) Rated 5 out of 5 ยท 1 ratings Can you automatically send an email from Excel?In Excel, it's possible to click on a cell and send an email automatically. This can be done with a formula using the HYPERLINK Function. You can create a hyperlink formula that uses the mailto command and auto-populates fields like to, subject, cc, and the body of an email.
In which form can an Excel workbook be sent via an email?Excel has a built-in feature called Send as Attachment that will attach the current file to a new email. This email can be created in Outlook, or your default email application. You can find the Send as Attachment button on the File menu, or add it to the Quick Access Toolbar (QAT).
|