S sds Unregistered / Unconfirmed GUEST, unregistred user! 1999-08-09 #1 我想在DELPHI4.0中实现: 创建EXCEL一个表,在其中a1:a10 分别插入数据,再创建一个相对A1:A10数据的三维饼图.
P pegasus Unregistered / Unconfirmed GUEST, unregistred user! 1999-08-09 #2 呵呵,用Delphi5很容易实现。 用Delphi4的话,需要像处理Word一样的方法,从Office安装盘里面 找到Excel的OLB或者TLB文件,然后用Delphi4 import进来,就可以 通过生成OLE AutoMation Object来操作Excel了,具体的例子请参看 Delphi4下面的Demos/ActiveX/OleAuto/Word8
呵呵,用Delphi5很容易实现。 用Delphi4的话,需要像处理Word一样的方法,从Office安装盘里面 找到Excel的OLB或者TLB文件,然后用Delphi4 import进来,就可以 通过生成OLE AutoMation Object来操作Excel了,具体的例子请参看 Delphi4下面的Demos/ActiveX/OleAuto/Word8
C CJ Unregistered / Unconfirmed GUEST, unregistred user! 1999-08-09 #3 hhe 补充一句,也许能捞点分: EXCEL的图标是用Microsoft Graph做的,所以要它
P pegasus Unregistered / Unconfirmed GUEST, unregistred user! 1999-08-10 #4 我这里有一个例子是一个类TExcel,寄给你,说不定有帮助, 不过例子中的实例程序是D2/D3的,我不知道在D4/D5下面行不行
S SeaSky Unregistered / Unconfirmed GUEST, unregistred user! 1999-08-11 #5 还得看我的:Delphi + excel 8 (调试通过) uses Comobj; const xlPie = 5; xlColumns = 2; xlLocationAsObject = 2; procedure TForm1.Button1Click(Sender: TObject); Var Excel_app,Excel_workbook : OleVariant; i: integer ; H :String; begin Excel_app:= createOleObject('Excel.application'); Excel_app.visible := true ; Excel_workbook := Excel_app.WorkBooks.Add ; for i:= 1 to 10 do begin H:='A'+IntTostr(i); Excel_workbook.activesheet.Range[H].value := i ;//随便给了一个值。 End; Excel_workbook.Charts.Add; Excel_workbook.ActiveChart.ChartType := xlPie ; Excel_workbook.ActiveChart.SetSourceData(Excel_workbook.Sheets['Sheet1'].Range['A1:A10'], xlColumns); Excel_workbook.ActiveChart.Location(xlLocationAsObject, 'Sheet1'); Excel_workbook.ActiveChart.HasTitle := False; Excel_app := null; end;
还得看我的:Delphi + excel 8 (调试通过) uses Comobj; const xlPie = 5; xlColumns = 2; xlLocationAsObject = 2; procedure TForm1.Button1Click(Sender: TObject); Var Excel_app,Excel_workbook : OleVariant; i: integer ; H :String; begin Excel_app:= createOleObject('Excel.application'); Excel_app.visible := true ; Excel_workbook := Excel_app.WorkBooks.Add ; for i:= 1 to 10 do begin H:='A'+IntTostr(i); Excel_workbook.activesheet.Range[H].value := i ;//随便给了一个值。 End; Excel_workbook.Charts.Add; Excel_workbook.ActiveChart.ChartType := xlPie ; Excel_workbook.ActiveChart.SetSourceData(Excel_workbook.Sheets['Sheet1'].Range['A1:A10'], xlColumns); Excel_workbook.ActiveChart.Location(xlLocationAsObject, 'Sheet1'); Excel_workbook.ActiveChart.HasTitle := False; Excel_app := null; end;
L lxwizard Unregistered / Unconfirmed GUEST, unregistred user! 2000-02-19 #7 搭车问个事,将Excel对象的属性.Visible:=true,Excel跑到前台来了,而如果是Word的话,则不会。为什么?怎样做才让我的Delphi程序保持在前台工作呢?
S sonie Unregistered / Unconfirmed GUEST, unregistred user! 2000-02-20 #8 lxwizard:不会吧,Visible设为TRUE的话,WORD也会跑到前台来呀,只有把它设为FALSE才不会。
L LSS Unregistered / Unconfirmed GUEST, unregistred user! 2000-03-03 #9 请问SeaSky: 如何设置单元格格式(字体,类型边框,合并...)
Y yyanghhong Unregistered / Unconfirmed GUEST, unregistred user! 2002-08-08 #13 To seeSky I encounder a problem, f there are 2 or 3 WorkSheets in Excel WorkBook. I want to locate this chart to sheet3, eg Excel_workbook.ActiveChart.Location(xlLocationAsObject, 'Sheet3'); but it is not work, the chart is still in first sheet.
To seeSky I encounder a problem, f there are 2 or 3 WorkSheets in Excel WorkBook. I want to locate this chart to sheet3, eg Excel_workbook.ActiveChart.Location(xlLocationAsObject, 'Sheet3'); but it is not work, the chart is still in first sheet.