Select a Chart in Excel

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • damian.mcbride@gmail.com

    Select a Chart in Excel

    I am using C# to take data from a database and place in an Excel 2003
    spreadsheet. Depending on the user query the data can be anything
    from a few rows to 1000 rows.

    The Excel 2003 sheet is a template with 4 existing Charts. The charts
    are formated with different colors and sizes etc. I want to select
    each chart in turn and adjust the source data and series data to match
    the number of rows.

    I am having trouble setting the chart object to the first chart.

    If I was doing this in a VBA macro the code would look like
    ActiveSheet.Cha rtObjects("Char t 1").Activate

    I am trying to use syntax like

    XL.Chart xlChart = (XL.Chart)wb.Ch arts.Select("Ch art 1");

    Any Suggestions ?


    Thanks
    Damian


Working...