excel 对单元格自动分行

excel: Variant;
WBk, WS, RG: OleVariant;


try
Excel := GetActiveOleObject('Excel.Application');
except
Excel := CreateOleObject('Excel.Application');
end;
wbk:=Excel.ActiveWorkbook;
WS:=Excel.Worksheets[1]

RG:=WS.Range[WS.Cells[3,1],WS.Cells[9,9]];
RG.HorizontalAlignment := xlHAlignCenter;
RG.VerticalAlignment := xlHAlignCenter;
RG.WrapText := True;

猜你喜欢

转载自www.cnblogs.com/liguang/p/12791719.html