对于第一个问题
var xl,xl1:olevariant;
filelist:Tstring;
begin
xl:=Createoleobject('excel.application');
xl.workbooks.add;
if opendialog1.execute then
filelist:=opendialog1.files;//选择多个需要转换的文件for i:=0 to filelist.count-1 do
begin
xl1:=Createoleobject('excel.application');
xl1.workbooks.open(filelist[i]);
xl1.cells.select;
xl1.selection.copy;
xl.worksheets.add;
xl.worksheets[i].active;
XL.cells.select;
XL.ActiveSheet.paste;Xl1.quit;end; end;第二个问题主要调用vba函数,自己研究吧
var xl,xl1:olevariant;
filelist:Tstring;
begin
xl:=Createoleobject('excel.application');
xl.workbooks.add;
if opendialog1.execute then
filelist:=opendialog1.files;//选择多个需要转换的文件for i:=0 to filelist.count-1 do
begin
xl1:=Createoleobject('excel.application');
xl1.workbooks.open(filelist[i]);
xl1.cells.select;
xl1.selection.copy;
xl.worksheets.add;
xl.worksheets[i].active;
XL.cells.select;
XL.ActiveSheet.paste;Xl1.quit;end; end;第二个问题主要调用vba函数,自己研究吧
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货