LoadFromStream raise exception "can`t open file """

Questions and answers on how to use XLSReadWriteII 3/4/5.
Post Reply
mustapha.wang
Posts: 10
Joined: Thu Nov 16, 2006 7:14 am

LoadFromStream raise exception "can`t open file """

Post by mustapha.wang »

var
MS:TMemoryStream;
begin
MS:=TMemoryStream.Create;
try
MS.LoadFromFile('D:\A.xls');
MS.Position:=0;
XLSReadWriteII41.LoadFromStream(MS);
fianlly
MS.Free;
end;

Why need open file??
mustapha.wang
Posts: 10
Joined: Thu Nov 16, 2006 7:14 am

Re: LoadFromStream raise exception "can`t open file """

Post by mustapha.wang »

you always fix bug too late.

Maybe:

xlsReadII4.pas

move this code to the top of this procedure:

procedure TXLSReadII.LoadFromStream(Stream: TStream);
.....
{$IFDEF USE_MSSTORAGE} //move to top
FXLSStream.ExtraObjects := FXLS.ExtraObjects; //move to top
FXLSStream.SourceStream := Stream; //move to top
{$ENDIF} //move to top
Post Reply