7 7030 Unregistered / Unconfirmed GUEST, unregistred user! 2000-04-30 #1 在做报表时,我想使用EXCEL中的某些函数,如SUM(),AVERAGE(),请问 如何在DELPHI中使用这些函数请高手帮忙,在此先谢了!!!!
X xWolf Unregistered / Unconfirmed GUEST, unregistred user! 2000-05-01 #2 ExcelApp, WorkBook: variant; ARow, ACol: Integer; // SUM()所在Cell BeginRow, EndRow: Integer; // SUM起迄行 ExcelApp := CreateOLEObject('Excel.Application'); WorkBook := ExcelApp.Workbooks.Add; // =SUM($1:$4) 列ACol从1到4行合计 ExcelApp..Cells[ARow, ACol].Formula := '= SUM($' + IntToStr(BeginRow) + ':$' + IntToStr(EndRow) + ')';
ExcelApp, WorkBook: variant; ARow, ACol: Integer; // SUM()所在Cell BeginRow, EndRow: Integer; // SUM起迄行 ExcelApp := CreateOLEObject('Excel.Application'); WorkBook := ExcelApp.Workbooks.Add; // =SUM($1:$4) 列ACol从1到4行合计 ExcelApp..Cells[ARow, ACol].Formula := '= SUM($' + IntToStr(BeginRow) + ':$' + IntToStr(EndRow) + ')';