VBA & Macro Problems

Save an Excel for Mac Chart as an Image Using VBA

Tauseeq MagsiTauseeq Magsi Nov 22, 2026 870 views

Question details

Save a chart or picture from Excel for Mac as an image when VBA chart export is unreliable.

Save an Excel for Mac Chart as an Image Using VBA
Product
Microsoft Excel for Mac 2016 and later
Device & OS
macOS
Scenario
A user wants to use VBA to prepare an Excel chart or picture for saving as an image file.
Observed behavior
Chart.Export may return an error or create a zero-byte file, and the standard Save as Picture command is not exposed to VBA in the same way as on Windows.
Before you start

Make sure the active worksheet contains the chart you want to copy and that macros are enabled for the workbook. The sample uses the first chart on the active sheet and pastes a picture at the active cell.

Solution 1Recommended

Copy the chart with VBA and save it through Preview

Use CopyPicture instead of Chart.Export, then manually save the copied chart as an image in Preview.

CopyPicture and worksheet paste do not create an image file by themselves. The Preview steps provide a separate manual way to save the copied picture.

1
Open the VBA editor

In Excel, open the Developer tab and select Visual Basic. Insert a module in the workbook using Insert > Module.

2
Add the macro

Paste this code into the module: Sub ChartAsPicture() Dim ws As Worksheet Set ws = ActiveSheet ws.ChartObjects(1).CopyPicture xlScreen, xlPicture ws.Paste Destination:=ActiveCell End Sub

3
Run the macro

Return to the worksheet, select a suitable destination cell, and run ChartAsPicture from Developer > Macros. The macro copies the first chart and pastes it as a picture.

4
Copy the pasted picture

Select the pasted picture on the worksheet and choose Edit > Copy.

5
Save an image file

Open Preview and choose File > New from Clipboard. Then choose File > Export, select a format such as PNG, choose a destination, and click Save.

Copy the chart with VBA and save it through Preview
Clipboard and version limitations: Direct picture export support varies by Excel for Mac version. If Preview cannot create an image from the clipboard, try copying the pasted picture again or use another image editor that accepts pasted images.
Free Microsoft Office alternative

Work with spreadsheet charts in WPS Office

WPS Office is a free, lightweight alternative with a familiar interface for working with spreadsheets and charts. Its Microsoft Office format compatibility helps you move existing files into WPS, though it does not fix Excel for Mac VBA export errors.

View and edit spreadsheet charts in a familiar interfaceOpen and save Microsoft Excel XLSX files for easier migrationUse a lightweight office suite with a free option
microsoft office alternative - wps office

Frequently Asked Questions

Does CopyPicture save the chart as a PNG?

No. CopyPicture places a picture on the clipboard, and the sample macro pastes it into the worksheet. To create a PNG, copy the pasted picture, open Preview, and use File > New from Clipboard followed by File > Export.

How do I copy a different chart with the macro?

In the VBA editor, change ChartObjects(1) to the index of the chart you want on the active worksheet. Select a destination cell and run the macro again from Developer > Macros.

Why is the exported chart file empty?

Chart.Export can produce a zero-byte file or an error in some Excel for Mac versions. Try the CopyPicture workaround and save the copied picture through Preview instead.

Can I use this approach for an existing picture?

The sample code targets a chart, not an existing picture. To save a picture manually, select it in Excel, choose Edit > Copy, and try File > New from Clipboard in Preview before exporting it.