uses ComObj;
//OldFileName: 原文件名(C:/*.xls),NewFileName: 新文件名(C:/*.txt)
procedure SaveXlsAsTxt(const OldFileName, NewFileName: string);
const
xlText= $FFFFEFC2;
var
XlsApp: OleVariant;
begin
try
try
XlsApp := CreateOleObject('Excel.Application');
XlsApp.DisplayAlerts := False;
XlsApp.WorkBooks.Open(OldFileName);
XlsApp.ActiveWorkbook.SaveAs(NewFileName, xlText, False);
except
end;
finally
if not VarIsEmpty(XlsApp) then
XlsApp.Quit;
XlsApp := Unassigned;
end;
end;