Z
zjok
Unregistered / Unconfirmed
GUEST, unregistred user!
//运行到最后一行( outv.saveas('d:/text/b1.xls'))出错,提示为
“mothod 'saveas' not supported by aotomotion object”,总是
不能存盘,请教请教!!!
begin
fieldcount:=3;
try
outv:=createoleobject('excel.application');
except
showmessage('无法打开Excel!');
exit;
end;
outv.visible:=true;
outv.workbooks.add;
outv.workbooks[1].worksheets[1].name:='data1';
outvsheet:=outv.workbooks[1].worksheets['data1'];
// outvsheet:=outv.activesheet; 同上
with Table1 do
begin
first;
while not eof do
begin
i:=i+1;
for j:=1 to fieldcount do
begin
outvsheet.cells[i,j].value:=fields[j-1].asString;
end;
next;
end;
end;
//showmessage(outv.workbooks[1].sheets.count);
//outv.displayalerts:=false;
outv.saveas('d:/text/b1.xls');
end;
“mothod 'saveas' not supported by aotomotion object”,总是
不能存盘,请教请教!!!
begin
fieldcount:=3;
try
outv:=createoleobject('excel.application');
except
showmessage('无法打开Excel!');
exit;
end;
outv.visible:=true;
outv.workbooks.add;
outv.workbooks[1].worksheets[1].name:='data1';
outvsheet:=outv.workbooks[1].worksheets['data1'];
// outvsheet:=outv.activesheet; 同上
with Table1 do
begin
first;
while not eof do
begin
i:=i+1;
for j:=1 to fieldcount do
begin
outvsheet.cells[i,j].value:=fields[j-1].asString;
end;
next;
end;
end;
//showmessage(outv.workbooks[1].sheets.count);
//outv.displayalerts:=false;
outv.saveas('d:/text/b1.xls');
end;