Problem with images and acces violation error

Questions and answers on how to use XLSReadWriteII 5.
Post Reply
maz65
Posts: 20
Joined: Sun Feb 09, 2014 6:52 pm

Problem with images and acces violation error

Post by maz65 »

Hi Lars,
here is my simple code: drop an xlsreadwrite component into an empty form, try to create an excel file from scratch with an image inside it, version is 2007 and xlsreadwrite 5 version is 5.20.14 :

Code: Select all

procedure TSDIAppForm.Button1Click(Sender: TObject);
begin
   XLS.Clear;
   XLS.FileName := 'c:\test.xlsx';
   XLS[0].Drawing.InsertImage('c:\myimage.jpg',0,1,0,0,1);
   XLS.Write;
end;
When I open it with Excel 2007 the image is not shown, but an error inside the image borders is telling me about memoy error, or fault image.

Note that if the image is a .bmp file , an access violation error occurs in InsertImage method.

Let me now, am I doing something wrong? Do you have an immediate workaround ?
Thanks & Regards
-Massimo
larsa
Site Admin
Posts: 926
Joined: Mon Jun 27, 2005 9:30 pm

Re: Problem with images and acces violation error

Post by larsa »

Hello

Please try the latest update.
Lars Arvidsson, Axolot Data
maz65
Posts: 20
Joined: Sun Feb 09, 2014 6:52 pm

Re: Problem with images and acces violation error

Post by maz65 »

Hello Lars,
now it works perfectly with jpg over muliple sheets, thanks !
(I have not tested with bmp files)
Now I have another question, related to migration, but I will start a new topic.

thanks,
Massimo
Post Reply