Link to home
Start Free TrialLog in
Avatar of cmdolcet
cmdolcetFlag for United States of America

asked on

how to add data to an excel chart using an arraylist

How can I add a series of 256 points to an Excel chart ? I have the code below however I can;t seem to find an add data property to the chart object?

Dim objApp As Excel.Application
        Dim objBook As Excel._Workbook
        Dim objBooks As Excel.Workbooks
        Dim objSheets As Excel.Sheets
        Dim objSheet As Excel._Worksheet
        Dim range As Excel.Range
        Dim chart As Excel.Chart

        ' Create a new instance of Excel and start a new workbook.
        objApp = New Excel.Application()
        objBooks = objApp.Workbooks
        objBook = objBooks.Add
        objSheets = objBook.Worksheets
        objSheet = objSheets(1)
        objApp.Visible = True
        objApp.UserControl = True
        'Add in Header Graph.
        objSheet.Shapes.AddPicture("C:\Header.png",
             Microsoft.Office.Core.MsoTriState.msoFalse,
             Microsoft.Office.Core.MsoTriState.msoCTrue, 50, 50, 0, 45)
        'Add in DataChart

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Norie
Norie

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of cmdolcet

ASKER

Ok then how do I add my Arraylist to an excel range?