F
foxczf
Unregistered / Unconfirmed
GUEST, unregistred user!
var
eclApp,WorkBook:Variant;
//声明为OLE Automation 对象
xlsFileName:string;
begin
xlsFileName:='ex.xls';
try
//创建OLE对象Excel Application与 WorkBook
eclApp:=CreateOleObject('Excel.Application');
eclApp.Visible:=True;
eclApp.DisplayAlerts := True;
eclApp.WorkBooks.Add;
WorkBook:=CreateOleobject('Excel.Sheet');
eclApp.ActiveSheet.PageSetup.LeftHeader := '页眉左';
eclApp.ActiveSheet.PageSetup.LeftMargin := 2;
eclApp.ActiveSheet.PageSetup.TopMargin := 2;
eclApp.ActiveSheet.PageSetup.RightMargin := 2;
eclApp.ActiveSheet.PageSetup.BottomMargin := 2;
eclApp.ActiveSheet.PageSetup.HeaderMargin := 2;
eclApp.ActiveSheet.PageSetup.FooterMargin := 2;
为什么 .PageSetup. (页面设置)时很慢
eclApp,WorkBook:Variant;
//声明为OLE Automation 对象
xlsFileName:string;
begin
xlsFileName:='ex.xls';
try
//创建OLE对象Excel Application与 WorkBook
eclApp:=CreateOleObject('Excel.Application');
eclApp.Visible:=True;
eclApp.DisplayAlerts := True;
eclApp.WorkBooks.Add;
WorkBook:=CreateOleobject('Excel.Sheet');
eclApp.ActiveSheet.PageSetup.LeftHeader := '页眉左';
eclApp.ActiveSheet.PageSetup.LeftMargin := 2;
eclApp.ActiveSheet.PageSetup.TopMargin := 2;
eclApp.ActiveSheet.PageSetup.RightMargin := 2;
eclApp.ActiveSheet.PageSetup.BottomMargin := 2;
eclApp.ActiveSheet.PageSetup.HeaderMargin := 2;
eclApp.ActiveSheet.PageSetup.FooterMargin := 2;
为什么 .PageSetup. (页面设置)时很慢