We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Error opening excel file containing Chart areas

I have been getting a 0x80030002 (STG_E_FILENOTFOUND) error when I attempt to open a template that contains Chart area controls. When I remove these controls, the file opens fine.

I have downloaded the latest hotfix (1.8.7), but I still got the same error. I am working on a XP machine, if that matters any.

Is this a known bug, or is there a workaround?

Thanks

Hi Russell,

Which edition are you using? Basic, Standard, Professional, Corporate or evaluation? Could you email me your template which caused this problem?

Thanks.

Hi Russell,

Yes. Those drawing objects caused this problem. I will fixed it in the next hotfix. It will be released within one week to 10 days.

You can delete those objects now and try other features.

Thanks for your patience.

Hi Russell,

The problem is fixed. Please download fix 1.8.8.1.

Thanks. The hot fix fixed the problem with the Chart objects, but it has caused a problem that I can’t identify. When I run the spreadsheet (I’ll send it to you shortly) that has been working, I get an error saying:

Erros in Excel Save method Invalid formula:

I looked at every formula on the page and didn’t see any that were invalid. Any ideas?

Russ

Hi Russell,

You can download the latest hotfix here. This problem is fixed.

Laurence,

Everything is working with the new hotfix. Thanks for all the help.

Russ

@RussellA,
We are glad to share that a new product is introduced which has replaced Aspose.Excel which is no more continued now. This new product i.e. Aspose.Cells has rich features for working with charts. You can create all the latest charts supported by different versions of MS Excel. Here is an example which demonstrates the creation of line with data markers chart:

// Instantiate a workbook
Workbook workbook = new Workbook();

// Access first worksheet
Worksheet worksheet = workbook.Worksheets[0];

// Set columns title 
worksheet.Cells[0, 0].Value = "X";
worksheet.Cells[0, 1].Value = "Y";

// Random data shall be used for generating the chart
Random R = new Random();

// Create random data and save in the cells
for (int i = 1; i < 21; i++)
{
    worksheet.Cells[i, 0].Value = i;
    worksheet.Cells[i, 1].Value = 0.8;
}

for (int i = 21; i < 41; i++)
{
    worksheet.Cells[i, 0].Value = i - 20;
    worksheet.Cells[i, 1].Value = 0.9;
}
// Add a chart to the worksheet
int idx = worksheet.Charts.Add(ChartType.LineWithDataMarkers, 1, 3, 20, 20);

// Access the newly created chart
Chart chart = worksheet.Charts[idx];

// Set chart style
chart.Style = 3;

// Set autoscaling value to true
chart.AutoScaling = true;

// Set foreground color white
chart.PlotArea.Area.ForegroundColor = Color.White;

// Set Properties of chart title
chart.Title.Text = "Sample Chart";

// Set chart type
chart.Type = ChartType.LineWithDataMarkers;

// Set Properties of categoryaxis title
chart.CategoryAxis.Title.Text = "Units";

//Set Properties of nseries
int s2_idx = chart.NSeries.Add("A2: A2", true);
int s3_idx = chart.NSeries.Add("A22: A22", true);

// Set IsColorVaried to true for varied points color
chart.NSeries.IsColorVaried = true;

// Set properties of background area and series markers
chart.NSeries[s2_idx].Area.Formatting = FormattingType.Custom;
chart.NSeries[s2_idx].Marker.Area.ForegroundColor = Color.Yellow;
chart.NSeries[s2_idx].Marker.Border.IsVisible = false;

// Set X and Y values of series chart
chart.NSeries[s2_idx].XValues = "A2: A21";
chart.NSeries[s2_idx].Values = "B2: B21";

// Set properties of background area and series markers
chart.NSeries[s3_idx].Area.Formatting = FormattingType.Custom;
chart.NSeries[s3_idx].Marker.Area.ForegroundColor = Color.Green;
chart.NSeries[s3_idx].Marker.Border.IsVisible = false;

// Set X and Y values of series chart
chart.NSeries[s3_idx].XValues = "A22: A41";
chart.NSeries[s3_idx].Values = "B22: B41";

// Save the workbook
workbook.Save(outputDir + @"LineWithDataMarkerChart.xlsx", Aspose.Cells.SaveFormat.Xlsx);

Here is a list of features regarding charts which are supported by this new product:
Charts

Here is the latest product version which can be downloaded for testing:
Aspose.Cells for .NET (Latest Version)

A detailed solution containing a number of ready to run examples is available here.