Delphi生成多Sheet的Excel檔案

2021-05-17 21:22:47 字數 821 閱讀 4983

delphi生成多sheet的excel檔案的**。

----------------------------------------

uses comobj;

range.columns[1].columnwidth := 6;  //序號

range.columns[2].columnwidth := 20; //檔號

range.columns[3].columnwidth := 60; //題名

range.columns[4].columnwidth := 12; //起始日期

range.columns[5].columnwidth := 12; //終止日期

range.columns[6].columnwidth := 8;  //保管期限

range.columns[7].columnwidth := 8;  //密級

end;

//判斷磁碟上是否已經存在excel檔案。

if fileexists(afilename) then

i***ist := true;

sheetname := '資料目錄'+anum; //第i個sheet

result := false;

exit;

end;

end;

renamefile(tmpfilename, afilename);

except

end;}

----------------------------------------

by  jrq 

2009/12/05 南京

VBA之sheet頁的生成

1.直接生成sheet頁 worksheets.add 直接生成sheet activesheets.name sheet1 給當前生成的sheet頁命名為sheet1 2.生成的sheet頁在指定的頁面前面 worksheets.add before worksheets sheet2 生成she...

Excel匯出生成多個sheet頁

一段用以在匯出操作時生成多個sheet頁的 匯出方法 apioperation value 盤點 匯出 notes 盤點 匯出 sheet頁3 資產盤點明細表 typename 資產盤點明細表 hssfsheet sheet3 workbook.createsheet typename list i...

Excel 自動根據Sheet名生成目錄

查閱了相關資料現將方法分享給大家 開啟你要建立,目錄的 按alt f11在談出的對話方塊中點插入選擇模組然後把下面的 複製到模組中 sub mulu on error goto tuichu dim i as integer dim shtcount as integer dim selection...