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.

can you tell me if you are generating a report in crystal or pdf file from excel?

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.

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?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.