logo
search
VBA & Macro Problems

How to Copy an Excel Range as an Image to an Outlook Email via VBA

Ayan MasoodAyan Masood Oct 20, 2026 868 views

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.

How to Copy an Excel Range as an Image into an Outlook Email using VBA
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.
Before you start

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.

Solution 1Recommended

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.

1
Copy the range as a picture

Open the VBA Editor (ALT + F11) and write a macro starting with `Range("B2:I17").CopyPicture` to copy the designated cells to your clipboard.

2
Create and display the email

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.

3
Paste the image into the body

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.

4
Attach the active workbook

Add the command `.Attachments.Add ActiveWorkbook.FullName` to the MailItem properties to append the current Excel file as a separate attachment.

Use VBA Word Editor to Paste the Range Image
Save Before Running: Make sure to save your active workbook before running the macro so that the most recent version of your file is attached to the email.

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. 1. Open WPS Spreadsheets: Launch WPS Office and open your workbook containing the data you want to automate.
  2. 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. 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.
Highly compatible with Microsoft Excel (.xlsx, .xlsm) and existing VBA scriptsBuilt-in VBA editor for creating, debugging, and testing macrosFree and lightweight alternative requiring zero learning curve
microsoft office alternative - wps office

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.