Drawing issue

Questions and answers on how to use XLSReadWriteII 5.
Post Reply
CareAll
Posts: 28
Joined: Mon Jun 24, 2013 9:30 am

Drawing issue

Post by CareAll »

Hello,

I have a simple Excel file containing a drawing. With the following code I load and save the file:

Code: Select all

procedure TForm1.FormCreate(Sender: TObject);
var
  XLS: TXLSReadWriteII5;
begin
  XLS := TXLSReadWriteII5.Create(Self);
  try
    XLS.Filename := 'Input.xlsx';
    XLS.Read;

    XLS.Filename := 'Output.xlsx';
    XLS.Version := xvExcel2007;
    XLS.Write;
  finally
    FreeAndNil(XLS);
  end;
end;
When I try to open it with Excel, it says the xl/drawings/drawing1.xml is corrupted.
Please take a look at this error, I send you the input and output files via e-mail.
larsa
Site Admin
Posts: 926
Joined: Mon Jun 27, 2005 9:30 pm

Re: Drawing issue

Post by larsa »

Hello

I Could not reproduce this. Your Output did not give any error when opened in excel.
Lars Arvidsson, Axolot Data
Shovey
Posts: 5
Joined: Wed Sep 10, 2014 4:37 am

Re: Drawing issue

Post by Shovey »

I actually encountered this same issue.
If I insert a picture into an excel file and save it.
I then use XLSReadWriteII to write some data to a sheet and then save.

This all works fine.
When I open the new file using Excel I get this error.

"We found a problem with some content in 'xxxx.xlsx' Do you want us to try to recover as much as we can?
If I click yet it gives another popup saying.
Repaired Records: Drawing from /xl/drawings/drawing3.xml part (Drawing Shape)

If I close the window everything appears to be fine. The picture still exists as well as the data that I wrote from XLSReadWrite.

Below is the Error log

Code: Select all

<?xml version="1.0" encoding="UTF-8" standalone="true"?>
-<recoveryLog xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"><logFileName>error067400_02.xml</logFileName><summary>Errors were detected in file 'D:\xx\Report 09 Sep 2014.xlsx'</summary>-<repairedRecords summary="Following is a list of repairs:"><repairedRecord>Repaired Records: Drawing from /xl/drawings/drawing3.xml part (Drawing shape)</repairedRecord></repairedRecords></recoveryLog>
Shovey
Posts: 5
Joined: Wed Sep 10, 2014 4:37 am

Re: Drawing issue

Post by Shovey »

I should add that I am using borland builder c++ XE5
with XLSSpreadsheet V2.00.02.
I have confirmed that the XLSReadWriteII5 is version 5.20.30
Post Reply