LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Chart to worksheet programmatically -- coordinates?

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(Typ e.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
--
Petr Prikryl (prikrylp at skil dot cz)


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
X,Y coordinates on chart lgarcia3 Charts and Charting in Excel 2 February 17th 06 11:46 AM
Using Air Coordinates in a Worksheet KalebsDad78 Excel Worksheet Functions 2 April 12th 05 06:51 AM
Analyzing X,Y,Z coordinates of a chart jenlo Excel Discussion (Misc queries) 1 January 31st 05 01:05 PM
Simple way to convert UTM ED50 coordinates to decimal coordinates? Dan[_38_] Excel Programming 8 July 11th 04 04:54 PM
Converting MouseDown Coordinates to Chart Point Coordinates Steve[_50_] Excel Programming 3 December 2nd 03 06:48 PM


All times are GMT +1. The time now is 08:19 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"