A
andriy
While trying to create a chart in Excel programmatically I am running
into a strange problem. I am trying to generate a line chart without
markers in ASP C# like so:
crt = ((ChartObjects)ws.ChartObjects(Missing.Value)).Add(200 /*Left*/,
300 /*Top*/, 900 /*Width*/, 500 /*Height*/).Chart;
sourceRange = ws.get_Range(startCell, endCell);
crt.ChartWizard(sourceRange, XlChartType.xlLine, Type.Missing,
XlRowCol.xlColumns, 1, 1, Type.Missing, Type.Missing, Type.Missing,
Type.Missing, Type.Missing);
crt.ChartTitle.Text = "Unfiltered Bus Laod Curve";
crt.ProtectFormatting = false;
crt.Activate();
When the program hits crt.Activate(), it throws
System.Runtime.InteropServices.COMException (0x800A03EC): Exception
from HRESULT: 0x800A03EC at
Microsoft.Office.Interop.Excel._Chart.Activate()
However, if I comment this line is, the exception is not thrown and I
can see the chart, however the chart is not editable.
Also, even though the chart type is set xlLine, it contains markers.
How can I get rid of them?
Any suggestions would be more than welcome
into a strange problem. I am trying to generate a line chart without
markers in ASP C# like so:
crt = ((ChartObjects)ws.ChartObjects(Missing.Value)).Add(200 /*Left*/,
300 /*Top*/, 900 /*Width*/, 500 /*Height*/).Chart;
sourceRange = ws.get_Range(startCell, endCell);
crt.ChartWizard(sourceRange, XlChartType.xlLine, Type.Missing,
XlRowCol.xlColumns, 1, 1, Type.Missing, Type.Missing, Type.Missing,
Type.Missing, Type.Missing);
crt.ChartTitle.Text = "Unfiltered Bus Laod Curve";
crt.ProtectFormatting = false;
crt.Activate();
When the program hits crt.Activate(), it throws
System.Runtime.InteropServices.COMException (0x800A03EC): Exception
from HRESULT: 0x800A03EC at
Microsoft.Office.Interop.Excel._Chart.Activate()
However, if I comment this line is, the exception is not thrown and I
can see the chart, however the chart is not editable.
Also, even though the chart type is set xlLine, it contains markers.
How can I get rid of them?
Any suggestions would be more than welcome