P
Petr Prikryl
Hi,
I am exporting the Excel document and my goal is to
place several chart objects into the worksheet.
I know the range (rectangle) of cells where the chart
should be placed. How can I convert the cell coordinates
into points that are used in the ChartObjects' Add() method?
Details:
The MSDN Library contains the example with title
"Code: Add a Chart to a Worksheet Programmatically (C#)"
Excel.Worksheet thisWorksheet;
thisWorksheet = thisWorkbook.ActiveSheet as Excel.Worksheet;
Excel.ChartObjects charts =
(Excel.ChartObjects)thisWorksheet.ChartObjects(Type.Missing);
// Adds a chart at x = 100, y = 300, 500 points wide and 300 tall.
Excel.ChartObject chartObj = charts.Add(100, 300, 500, 300);
Excel.Chart chart = chartObj.Chart;
Instead of fixed values 100, 300, 500, 300 -- how can I get the coordinates
where visually the cells from range (say) "H4:J20" sit?
Thanks for your time and experience,
Petr
I am exporting the Excel document and my goal is to
place several chart objects into the worksheet.
I know the range (rectangle) of cells where the chart
should be placed. How can I convert the cell coordinates
into points that are used in the ChartObjects' Add() method?
Details:
The MSDN Library contains the example with title
"Code: Add a Chart to a Worksheet Programmatically (C#)"
Excel.Worksheet thisWorksheet;
thisWorksheet = thisWorkbook.ActiveSheet as Excel.Worksheet;
Excel.ChartObjects charts =
(Excel.ChartObjects)thisWorksheet.ChartObjects(Type.Missing);
// Adds a chart at x = 100, y = 300, 500 points wide and 300 tall.
Excel.ChartObject chartObj = charts.Add(100, 300, 500, 300);
Excel.Chart chart = chartObj.Chart;
Instead of fixed values 100, 300, 500, 300 -- how can I get the coordinates
where visually the cells from range (say) "H4:J20" sit?
Thanks for your time and experience,
Petr