logo
search
Chart & Visualization Issues

How to Manage Maximum Excel Chart Size and Export via VBA

Steven ParkerSteven Parker Oct 19, 2026 869 views

Question details

The user needs to understand the maximum dimensions for Excel charts and how to reliably export very large charts as images without axis values and labels compressing or overlapping.

How to Manage Maximum Excel Chart Size and Export via VBA
Product
Excel
Device & OS
Windows 10
Scenario
Exporting exceptionally large Excel charts as image files cleanly without losing label readability.
Observed behavior
Excel chart objects hit a maximum size limit of 169,056 points, causing axis values and labels to compress or overlap, making direct high-quality exports difficult.
Before you start

Ensure you save your current workbook as an Excel Macro-Enabled Workbook (.xlsm) so that the VBA script can run successfully.

Solution 1Recommended

Use a VBA Macro to Temporarily Resize and Export the Chart

This method safely resizes the chart to standard A4 dimensions, exports it as a JPG, and automatically restores its original size.

The maximum chart object width and height in Excel is 169,056 points (approximately 2,348 inches). However, practical limits are often reached sooner when labels compress or overlap. This VBA script resizes the chart to standard page proportions (11.6 by 8.2 inches) before exporting to ensure high readability.

1
Open the Visual Basic Editor

Press Alt + F11 on your keyboard to launch the Visual Basic Editor in your Excel workbook.

2
Insert a New Module and Paste the Code

From the top menu, select Insert > Module. Paste the following VBA code into the blank module window: Sub Export_ObjChart_As_Pic() Dim newFolder As String newFolder = CreateObject("WScript.Shell").SpecialFolders("Desktop") & "\fd-pic\" If Dir(newFolder, vbDirectory) = Empty Then MkDir newFolder Dim cht As ChartObject Dim w As Single Dim h As Single Set cht = ActiveSheet.ChartObjects(1) w = cht.Width h = cht.Height Application.ScreenUpdating = False cht.Width = Application.InchesToPoints(11.6) cht.Height = Application.InchesToPoints(8.2) cht.Chart.Export newFolder & cht.Name & ".jpg", "JPG" cht.Height = h cht.Width = w Application.ScreenUpdating = True End Sub

3
Run the Macro

Press Alt + Q to close the Visual Basic Editor. Then, press Alt + F8, select 'Export_ObjChart_As_Pic' from the macro list, and click Run. Alternatively, you can assign this macro to a custom button on your worksheet.

Use a VBA Macro to Temporarily Resize and Export the Chart
Export Location: The macro automatically creates a folder named 'fd-pic' on your Desktop and seamlessly saves the exported JPG image file there.
Advanced Chart Management

Easily Manage and Export Charts with WPS Spreadsheet

WPS Spreadsheet fully supports VBA macros, allowing you to seamlessly run chart-resizing scripts and export high-quality visuals without compatibility issues.

  1. 1. Open your workbook: Launch WPS Spreadsheet and open your .xlsm file containing the large chart.
  2. 2. Access the Developer Tools: Navigate to the Developer tab on the top ribbon and click on the 'Visual Basic' editor icon.
  3. 3. Run the Macro: Insert the chart export VBA code into a module, then press Run to save the JPG seamlessly to your computer.
100% compatible with Microsoft Excel formats (.xlsx, .xlsm)Full support for advanced VBA macros and scriptingLightweight application with high performance for large datasetsBuilt-in intuitive chart customization and export tools
microsoft office alternative - wps office

Frequently Asked Questions

What is the maximum size for an Excel chart?

The maximum width and height for a chart object in Excel is 169,056 points, which translates to approximately 2,348 inches.

Why do my chart axis labels overlap when the chart is very large?

As charts scale to extreme dimensions, the relative rendering of fonts and axis bounds can fail to keep up proportionally, causing text to compress or overlap. It is recommended to resize the chart to a standard page dimension before exporting.

How do I save an Excel file to support VBA macros?

You must save your workbook as an Excel Macro-Enabled Workbook by selecting 'Save As' and choosing the '.xlsm' extension from the format dropdown. Standard '.xlsx' files cannot permanently store VBA code.

Can I export an Excel chart directly as an image without VBA?

Yes, you can right-click the outer edge of any chart and select 'Save as Picture'. However, using VBA is better for temporarily standardizing dimensions to prevent label overlap during the export process.