T
thomas.ziolko
hi,
i don't get access to the secondary axis by using the excel interop in
c#
at the following code i get an error "Exception from HRESULT:
0x800A03EC" (-2146827284)
//Add a Chart for the selected data.
oChart = (Excel.Chart)wb.Charts.Add(Missing.Value, Missing.Value,
Missing.Value, Missing.Value);
oChart.ChartType = XlChartType.xlColumnStacked;
oChart.set_HasAxis(Excel.XlAxisType.xlCategory,
Excel.XlAxisGroup.xlPrimary, true);
oChart.set_HasAxis(Excel.XlAxisType.xlValue,
Excel.XlAxisGroup.xlPrimary, true);
oChart.set_HasAxis(Excel.XlAxisType.xlCategory,
Excel.XlAxisGroup.xlSecondary, true);
oChart.set_HasAxis(Excel.XlAxisType.xlValue,
Excel.XlAxisGroup.xlSecondary, true);
Excel.Axis axCategory2 =
(Excel.Axis)oChart.Axes(Excel.XlAxisType.xlCategory,
Excel.XlAxisGroup.xlSecondary);
axCategory2.CategoryType = XlCategoryType.xlAutomaticScale;
axCategory2.Border.Weight = 1;
Excel.Axis axCategory =
(Excel.Axis)oChart.Axes(Excel.XlAxisType.xlCategory,
Excel.XlAxisGroup.xlPrimary);
axCategory.Border.LineStyle = Excel.XlLineStyle.xlDot;
axCategory.TickLabels.Orientation =
XlTickLabelOrientation.xlTickLabelOrientationHorizontal;
axCategory.TickLabels.Font.Size = 8;
oResizeRange = oWS.get_Range("B1:B" + anzDSReal.ToString(),
Missing.Value);
oChart.SetSourceData(oResizeRange, Excel.XlRowCol.xlColumns);
oChart.HasLegend = false;
....
can anyone help?
Thx
Thomas
i don't get access to the secondary axis by using the excel interop in
c#
at the following code i get an error "Exception from HRESULT:
0x800A03EC" (-2146827284)
//Add a Chart for the selected data.
oChart = (Excel.Chart)wb.Charts.Add(Missing.Value, Missing.Value,
Missing.Value, Missing.Value);
oChart.ChartType = XlChartType.xlColumnStacked;
oChart.set_HasAxis(Excel.XlAxisType.xlCategory,
Excel.XlAxisGroup.xlPrimary, true);
oChart.set_HasAxis(Excel.XlAxisType.xlValue,
Excel.XlAxisGroup.xlPrimary, true);
oChart.set_HasAxis(Excel.XlAxisType.xlCategory,
Excel.XlAxisGroup.xlSecondary, true);
oChart.set_HasAxis(Excel.XlAxisType.xlValue,
Excel.XlAxisGroup.xlSecondary, true);
Excel.Axis axCategory2 =
(Excel.Axis)oChart.Axes(Excel.XlAxisType.xlCategory,
Excel.XlAxisGroup.xlSecondary);
axCategory2.CategoryType = XlCategoryType.xlAutomaticScale;
axCategory2.Border.Weight = 1;
Excel.Axis axCategory =
(Excel.Axis)oChart.Axes(Excel.XlAxisType.xlCategory,
Excel.XlAxisGroup.xlPrimary);
axCategory.Border.LineStyle = Excel.XlLineStyle.xlDot;
axCategory.TickLabels.Orientation =
XlTickLabelOrientation.xlTickLabelOrientationHorizontal;
axCategory.TickLabels.Font.Size = 8;
oResizeRange = oWS.get_Range("B1:B" + anzDSReal.ToString(),
Missing.Value);
oChart.SetSourceData(oResizeRange, Excel.XlRowCol.xlColumns);
oChart.HasLegend = false;
....
can anyone help?
Thx
Thomas