0

i have an excel spreadsheet and i need to select a couple of ranges of data from a table and then to create a graph with these ranges. In excel you can use the crtl key to select discontinuous ranges and i c#
you can say

Excel.get_Range range = thisSheet.get_range("A2":"A6","c2":"c6", Type.Missing)

(Excel.get_Range range = thisSheet.get_range("A2:A6","C2:C6"); creates a range from A2 to C6 which isn't what i want).

but once i put this into the graph it all goes wrong.


Any help would be welcome

if anyone is reading this who has the same problem i do have a "hacked" solution, create a links (= celladdress) to all the required cells in a hidden continuous range and simply use this range in the chart.

2
Contributors
3
Replies
4
Views
13 Years
Discussion Span
Last Post by payam
0

hi shabosco
i am reading data from a XML file, and then display the information in Excel. i always have to create a table and in some cases a chart as well. My aim is to link the chart to the table so any changes in the table will be shown in the chart.

0

His is a sample of my code,

range = thisSheet.get_Range("A9:A12"+ otherRange.get_Address(true,true, Excel.XlReferenceStyle.xlA1,true,Missing.Value),Type.Missing);
range.Value2 = 123; //test the created range
newSeries.Values = range;

the values in the cells change but the chart doesn't accept the range. I am using excel 2000 is this the problem?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.