Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7844587
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T16:55:36+00:00 2026-06-02T16:55:36+00:00

I need to create an excel chart in an excel page from a delphi

  • 0

I need to create an excel chart in an excel page from a delphi program.

I am getting ‘Member not found’ error on reaching the line.

ch1.Chart.SeriesCollection.Item[0].Values := Sheets.Item['Delphi Data'].Range['E5:E15'];

Can you please help me to solve it

Below given is the code used.

procedure TForm1.ChartData;
var
     ARange,Sheets,ch1 : Variant; 
     SSeries : Series; 
     num : integer; 
     ChartAxis : Axis; 
     lcid :  Cardinal; 
begin 
  ch1 := XLApp.ActiveWorkBook.Sheets[1].ChartObjects.Add ( 500,100,400,200 ); // creates a new chart in the specified 
  Sheets := XLApp.Sheets; 
  ch1.Chart.ChartWizard ( 
                         Sheets.Item['Delphi Data'].Range['D5:D15'],   // 1  Source 
                         xlBarStacked, //  2  The chart type. 
                         8,            //  3  Format  
                         2,            //  4  PlotBy  
                         8,            //  5  CategoryLabels  
                         3,            //  6  SeriesLabels  
                         True,        //  7  HasLegend - 'true' to include a legend. 
                         'Sijos Report',  // 8  Title - The Chart control title text. 
                         'Y Legend',      // 9  CategoryTitle - The category axis title text. 
                         'X Legend',      // 10  ValueTitle - The value axis title text 
                         2                // 11  ExtraTitle - The series axis title for 3-D charts or the second value axis title for 2-D charts. 
                       ); 
ch1.Chart.SetSourceData(Sheets.Item['Delphi Data'].Range['D5:D15'],xlColumns); 

ch1.Chart.SeriesCollection.Item[0].Values := Sheets.Item['Delphi Data'].Range['E5:E15']; 
ch1.Chart.SeriesCollection.Item[0].XValues := Sheets.Item['Delphi Data'].Range['F5:F15'];  
End;
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T16:55:38+00:00Added an answer on June 2, 2026 at 4:55 pm

    I think you need ch1.Chart.SeriesCollection(1) rather than ch1.Chart.SeriesCollection.Item[0] since Excel uses 1-based indexing.

    I also could not get your code, using late bound COM to work at all when accessing the series object. But if you switch to using early bound COM then it is fine. You will need to add Excel2000, for example, to your uses clause.

    var
      S: Series;
    ....
    S := IUnknown(ch1.Chart.SeriesCollection(1)) as Series;
    S.Values := Sheets.Item['Delphi Data'].Range['E5:E15']; 
    S.XValues := Sheets.Item['Delphi Data'].Range['F5:F15'];  
    

    If I were you I would switch the whole code to early bound.

    I think your code is based on this Delphi 3 example from Charlie Calvert. I could not get that to work on my Delphi 6. Perhaps Delphi changed. Perhaps Excel changed. No matter, the thing that made it work for me was to switch to early bound COM.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to create a chart in excel in a delphi application based on
I need to create an array from a list of data in excel. The
I need to create excel sheet from my Java code which contains charts like
I'm using Visual Studio 2008 and I need create a DataTable from a Excel
I need to create a script that extracts some data from a complex Excel
I need to create a Chart which will grab data from external sources when
I'm trying to write a program to create a chart in excel by C#.
I need to create an excel file from scratch in VB.NET given a DataTable
I am using excel to draw charts from c#, but i need the chart
I need to create one chart per sheet in Excel. Here is my code:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.