How to Copy an Excel Range as an Image to an Outlook Email via VBA
Question details
The user wants to automate sending an Outlook email using an Excel VBA macro, embedding a specific cell range as a picture in the email body, and attaching the current workbook.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Automating email reports where a completed Excel form needs to be sent as an embedded image along with the source file via Outlook upon clicking a button.
- Observed behavior
- The goal is to trigger a macro via an ActiveX button that copies a designated range, creates an Outlook email, pastes the image, attaches the workbook, and displays the draft for review.
Ensure that Microsoft Outlook is installed and configured on your computer. If you are using early binding in your VBA code, verify that the 'Microsoft Outlook Object Library' and 'Microsoft Word Object Library' references are enabled in your VBA editor.
Use VBA Word Editor to Paste the Range Image
The most reliable method is to copy the range as a picture in Excel and paste it directly into the Outlook email body using the Word Editor object.
This approach creates the email item first, displays it to initialize the inspector window, and then leverages the built-in Word editor's paste function to embed the clipboard image seamlessly.
Open the VBA Editor (ALT + F11) and write a macro starting with `Range("B2:I17").CopyPicture` to copy the designated cells to your clipboard.
Initialize the Outlook Application object and create a new MailItem using `CreateItem(0)`. Set the recipient and subject, then use the `.Display` method to show the draft window.
Access the body of the email using `GetInspector.WordEditor`. Position the cursor where you want the image to appear and execute the paste command through the Word selection object.
Add the command `.Attachments.Add ActiveWorkbook.FullName` to the MailItem properties to append the current Excel file as a separate attachment.

Assign the Macro to an ActiveX Button
Once your VBA script is ready, assign it to an ActiveX button on your worksheet for quick, one-click execution by users.
Automate Your Spreadsheets with WPS Office
WPS Spreadsheets fully supports VBA macros, allowing you to write scripts that copy ranges, interact with email clients like Outlook, and automate your daily workflow just like in Microsoft Excel.
- 1. Open WPS Spreadsheets: Launch WPS Office and open your workbook containing the data you want to automate.
- 2. Access the VBA Editor: Navigate to the 'Tools' tab on the top ribbon and click on 'Macros' or 'VBA Editor' to open the scripting environment.
- 3. Insert your script: Create a new module, paste your Outlook automation script, and run it or assign it to a worksheet button for one-click access.

Frequently Asked Questions
Why does the macro send the email immediately without letting me review it?
If your VBA script uses the `.Send` method at the end of the Outlook MailItem configuration, the email will bypass the draft window and send immediately. To review the email first, change `.Send` to `.Display`.
How can I embed the image using HTML instead of the Word Editor?
You can export the copied range as a temporary image file (like a .jpg or .png) to your local drive. Then, attach it to the email and reference it within the `.HTMLBody` property using a valid `cid:` (Content-ID) tag that matches the attachment.
Why is the attached workbook not showing my most recent changes?
The `.Attachments.Add ActiveWorkbook.FullName` command attaches the last saved version of the file located on your hard drive. To ensure all recent changes are included, add the command `ActiveWorkbook.Save` at the very beginning of your macro.




