乔山办公网我们一直在努力
您的位置:乔山办公网 > excel表格制作 > -delphi 读取 excel,delphi excel

-delphi 读取 excel,delphi excel

作者:乔山办公网日期:

返回目录:excel表格制作







( 一 ) 使用动态创建的方法

首先创建 Excel 对象,使用ComObj :
Var
ExcelApp : Variant ;
ExcelApp := CreateOleObject ( '' Excel.Application '' ) ;

1 ) 显示当前窗口:
ExcelApp.Visible := True ;

2 ) 更改 Excel 标题栏:
ExcelApp.Caption := '' 应用程序调用 Microsoft Excel '' ;

3 ) 添加新工作簿e79fa5e98193e58685e5aeb9330
ExcelApp.WorkBooks.Add ;

4 ) 打开已存在的工作簿:
ExcelApp.WorkBooks.Open ( '' C : \Excel\Demo.xls '' ) ;

5 ) 设置第2个工作表为活动工作表:
ExcelApp.WorkSheets [ 2 ] .Activate ;

ExcelApp.WorksSheets [ '' Sheet2 '' ] .Activate ;

6 ) 给单元格赋值:
ExcelApp.Cells [ 1 , 4 ] .Value := '' 第一行第四列 '' ;

7 ) 设置指定列的宽度(单位:字符个数),以第一列为例:
ExcelApp.ActiveSheet.Columns [ 1 ] .ColumnsWidth := 5 ;

8 ) 设置指定行的高度(单位:磅)(1磅=0.035 厘米),以第二行为例:
ExcelApp.ActiveSheet.Rows [ 2 ] .RowHeight := 1 / 0.035 ; // 1厘米

相关阅读

  • -delphi 读取 excel,delphi excel

  • 乔山办公网excel表格制作
  • ( 一 ) 使用动态创建的方法首先创建 Excel 对象,使用ComObj :VarExcelApp : Variant ;ExcelApp := CreateOleObject ( Excel.Application ) ;1 ) 显示当前窗口:ExcelApp.Visible := True
  • 使用<em>Delphi</em>操纵<em>Excel</em>时,如

  • 乔山办公网excel表格制作
  • 我觉得这个跟百你使用的Excel控件的版本有关,比如,度我写过如下问代码:ExcelApplication1.WorkSheets[1].Activate; 但在编写的时候出错,答告诉我WorkSheets[1]不存在Activate函数,我查看内了下,
关键词不能为空
极力推荐

ppt怎么做_excel表格制作_office365_word文档_365办公网