Board index » delphi » Delphi 5 Excel Chart

Delphi 5 Excel Chart

Hi!

Can someone please tell me how to activate a chart on a specific worksheet.
I have tried the following but it doesnt work:

var TSUChart : TExcelChart;
      ReportingWorkSheet : _WorkSheet;

TSUChart.ConnectTo(ReportingWorkSheet.ChartObjects('Chart 1',lcid) as
_Chart);

 I use Delphi 5 Office servers

Please!

 

Re:Delphi 5 Excel Chart


<<Pierre Barnard:
Can someone please tell me how to activate a chart on a
specific worksheet.

Quote

The Chart.Activate method doesn't work quite as advertised
- you need to use the ChartObject's Activate method:

var
  ChObj: ChartObject;
begin
  ChObj := (WS.ChartObjects(1) as ChartObject);
  ChObj.Activate;
  TSUChart.ConnectTo(Excel.ActiveChart);
  TSUChart.ChartType := xl3DBarStacked;
  TSUChart.ChartArea[lcid].Select;

--
Deborah Pate (TeamB) http://delphi-jedi.org

  Use Borland servers; TeamB don't see posts via ISPs
  http://www.borland.com/newsgroups/genl_faqs.html

Other Threads