logo
search
Chart & Visualization Issues

How to Control Excel VBA Chart Export Image Resolution

Emma BrownEmma Brown Oct 16, 2026 870 views

Question details

The user needs to export a chart via Excel VBA at a high enough DPI so that the image retains its correct physical dimensions when inserted into a Word document.

How to Control Excel VBA Chart Export Image Resolution
Product
Excel
Device & OS
not provided
Scenario
Automating chart exports using the ActiveChart.Export method in an Excel VBA macro.
Observed behavior
Charts exported via the VBA ActiveChart.Export method have a lower DPI than those saved manually as a picture, causing the image to appear in the wrong size when inserted into Word.
Before you start

Ensure that your workbook is saved in a macro-enabled format (.xlsm) and that you have enabled the Developer tab to access the Visual Basic editor.

Solution 1Recommended

Use the ActiveWindow Zoom Workaround in VBA

Since VBA does not have a native DPI parameter for chart exports, you can force a higher resolution output by temporarily increasing the window zoom percentage before exporting.

The ActiveChart.Export method captures the chart based on the current screen rendering. By increasing the ActiveWindow zoom level to a high value like 300%, you force Excel to render the chart at a much larger pixel size, thereby increasing the effective resolution of the exported image.

1
Open the VBA Editor

Press Alt + F11 in Excel to open the Visual Basic for Applications (VBA) window, and navigate to the module containing your chart export macro.

2
Store the current zoom level

Declare a variable to remember the user's current zoom setting by adding: Dim lngZoom As Long lngZoom = ActiveWindow.Zoom

3
Increase the zoom percentage

Set the zoom to a high value before the export command: ActiveWindow.Zoom = 300

4
Export the chart and restore zoom

Run your export command (e.g., ActiveChart.Export "C:\MyPicture.jpg", "JPG"), and immediately restore the original view by adding: ActiveWindow.Zoom = lngZoom

Use the ActiveWindow Zoom Workaround in VBA
DPI Metadata limitations: While this increases the pixel dimensions and visual quality, it may not change the actual DPI metadata embedded in the image file. An external image processing tool might still be needed if Word requires strict DPI metadata to scale the image automatically.
Export High-Resolution Charts easily

Export High-Resolution Charts Natively in WPS Office

Avoid complex VBA workarounds. WPS Spreadsheet provides intuitive built-in tools to directly export charts and cell ranges as high-quality images, giving you complete control over output quality for your documents and presentations.

  1. 1. Open your spreadsheet: Launch WPS Office and open your workbook containing the chart.
  2. 2. Select the chart: Click on the chart you wish to export to make it active.
  3. 3. Export as Picture: Right-click the chart and choose the 'Save as Picture' option, then select your preferred image format and destination to save the high-resolution file.
Native high-quality picture export without writing complex VBA codeFully compatible with Microsoft Excel files (.xlsx) and macro formats (.xlsm)Lightweight application with incredibly fast performanceSeamless integration with WPS Writer for easy report generation
microsoft office alternative - wps office

Frequently Asked Questions

Why does ActiveChart.Export output lower DPI images?

The ActiveChart.Export method in Excel VBA defaults to screen resolution (typically 96 DPI). It prioritizes rendering the on-screen display over print-quality DPI metadata, which causes images to appear differently when inserted into physical-dimension-based applications like Word.

Can I specify an exact DPI parameter in Excel VBA?

No, Excel VBA does not provide a direct parameter in the ActiveChart.Export method to specify the exact DPI (such as 300 DPI). You must use visual scaling workarounds (like changing the Window Zoom) or rely on third-party image manipulation libraries.

How do I stop Word from resizing my inserted charts?

Word uses the image's embedded DPI metadata to calculate its physical size on the page. If the image was exported at 96 DPI instead of 220 or 300 DPI, Word scales it up. You can fix this by using a basic image editor to change the DPI metadata to match your target print resolution without resampling the image, then insert it into Word.