Read Excel cell and write to text with unicode ?
Posted: Fri Mar 30, 2007 1:49 pm
hi
i need read excel cell then write to a text file with unicode.
my procedure here :
But output file not correct, can you help me !!
i need read excel cell then write to a text file with unicode.
my procedure here :
Code: Select all
procedure ConvertToXML(sheetindex:Integer;xlsfile:String;outfile:String);
var
XLS:TXLSReadWriteII2;
col,row:integer;
ws:TStringList;
begin
XLS:=TXLSReadWriteII2.Create(nil);
XLS.Filename:=xlsfile;
XLS.Read;
ws:=TStringList.Create;
for row:=0 to XLS.Sheets[sheetindex].LastRow do
begin
for col:=0 to XLS.Sheets[sheetindex].LastCol do
begin
ws.Add(XLS.Sheets[sheetindex].AsWideString[col,row]);
end;
end;
ws.SaveToFile(outfile);
ws.Free();
end;