var
sheet: olevariant;
exls: Variant;
iRow, iCol : integer;
begin
try
exls:=createoleobject('Excel.application');
exls.Workbooks.Add(); //
exls.Workbooks[1].WorkSheets[1].Name := 'abc';
sheet:= exls.workbooks[1].worksheets[1];
for iRow:=0 to SG1.RowCount-1 do begin
for iCol := 0 to SG1.ColCount-1 do begin
sheet.Cells.Item[iRow+1,iCol+1] := SG1.Cells[iCol,iRow];
end;
end;
exls.visible:=true;
当SG1.Cells[iCol,iRow]='6-10'或n-n,n为数字的时候
在excel中自动变成了6月10日,怎么才能在excel中显示6-10
sheet: olevariant;
exls: Variant;
iRow, iCol : integer;
begin
try
exls:=createoleobject('Excel.application');
exls.Workbooks.Add(); //
exls.Workbooks[1].WorkSheets[1].Name := 'abc';
sheet:= exls.workbooks[1].worksheets[1];
for iRow:=0 to SG1.RowCount-1 do begin
for iCol := 0 to SG1.ColCount-1 do begin
sheet.Cells.Item[iRow+1,iCol+1] := SG1.Cells[iCol,iRow];
end;
end;
exls.visible:=true;
当SG1.Cells[iCol,iRow]='6-10'或n-n,n为数字的时候
在excel中自动变成了6月10日,怎么才能在excel中显示6-10
这样试一试
sheet.Cells[iRow+1,iCol+1].Text := SG1.Cells[iCol,iRow];
sheet.ColumnRange.Columns[4].numberformatlocal:='@';我这么些的包错了说没有这个方法
那里可以查到帮助阿
我是用SERVER连接的