C
chen_liang
Unregistered / Unconfirmed
GUEST, unregistred user!
请教各位大侠delphi7生成excel图表的代码,环境是office2003,谢谢!<br>var achart1,asheet1,excel,series: variant;<br><br>begin<br><br>excel:=createOleObject('Excel.Application');<br>excel.visible:=true;<br>excel.WorkBooks.Add();<br>excel.WorkSheets[1].Activate;<br>excel.Cells[1,1].Value := 1;<br>.................<br>asheet1:=excel.Workbooks[1].Worksheets[1];<br>achart1:=asheet1.chartobjects.add(100,100,200,200);<br>achart1.chart.charttype:=4;<br>achart1.Chart.HasTitle:=True;//这里报错“属性不能设置”<br>achart1.Chart.ChartTitle.Text:='Excle二维图';/这里也报错“属性不能设置”<br>//去处上面两行代码可以生成图表<br><br>series:=achart1.chart.seriescollection;<br>series.add('Sheet1! A1:A7',true);<br>if not varisEmPty(excel) then<br>excel:=unassigned;<br><br>请问哪位大侠有生成chart的完整代码,指点一下小弟,谢谢!