Home     Products      Support      Corporate     Sign In 
Support Knowledge Base, Article 1283
Chart height incorrect or chart missing when creating charts programmatically with ExcelWriter 6.9.2

In version 6.9.2, an issue was introduced regarding the height property of the chart object. When using ExcelApplication to create a new chart on a spreadsheet, a chart with unchangeable height will be created, sometimes having its value set to a negative number causing it to disappear altogether.

The height assigned to the chart by default will depend on the location of the chart and re-assigning the height will have no affect. Setting the location (anchor) of a chart to row 2 or lower in the worksheet will set a negative height value. This will cause the chart to become invisible. A chart with Anchor set to a row above 2 will be visible, but will have a seemingly random and unchangeable height. Creating the chart and then changing it's location using the Position property will not solve the problem.

Note: this problem occurs only with charts created programmatically on a worksheet.


SoftArtisans is working to resolve this issue as quickly as possible. The number of the version in which this bug is fixed will be added to this article.

In the meantime, there are three workarounds:

  • Use an input file that contains a chart, then modify it using ExcelApplication. Since this bug only affects charts created programmatically, charts that already exist in an input file will work properly.

    The following code will get a handle on the first existing chart using the worksheet Charts collection:
    Chart crt = ws.Charts[0];
    Dim crt As Chart
    crt = ws.Charts(0)

  • Create the chart on a ChartSheet instead of on a WorkSheet:
     Chartsheet cs = wb.Worksheets.CreateChartsheet(ChartType.Column.Clustered, 
     Chartsheet cs = wb.Worksheets.CreateChartsheet(ChartType.Column.Clustered, 

  • Downgrade to version 6.9.1

We apologize to our users for the inconvenience.
Created : 10/20/2008 1:04:49 PM (last modified : 10/24/2008 2:01:45 PM)
Rate this article!