Item has already been added. Key in dictionary: '0ecff379-717b-4ae9-88c8-0d8c4180f00a' Key being added: '0ecff379-717b-4ae9-88c8-0d8c4180f00a'

Hi,

We use Aspose.Total 22.11.0 for .NET to convert old Office-files to newer Office formats. We got Aspose.Words and Aspose.Slides working. Aspose.Cells seems to have trouble saving .xls files to newer .xlsx. Aspose throws the following error when trying to save the file to xlsx:

Item has already been added. Key in dictionary: ‘0ecff379-717b-4ae9-88c8-0d8c4180f00a’ Key being added: ‘0ecff379-717b-4ae9-88c8-0d8c4180f00a’

Note that the guid in this exception is always the same (regardless of the time of running or the file used).

  • I have tried the following:
  • Using a different file-format to save the .xls file (ig ods, xls, pdf etc.) works.
  • I have tried many .xls files, including newly created office 97-2003 files (using Office365), they all throw the same error.
  • Loading an .xlsx file and saving as a .xlsx file DOES work.
  • I have tried to use the methods “RemoveDigitalSignature, RemoveMacro, RemovePersonalInformation, RemoveUnusedStyleFormats” before savng the file to remove some potential data that might cause conversion troubles.
  • Also I have checked whether Aspose detects the right format through the property “FileFormat”. It does.
  • I have tried installing different versions of Aspose.Cells. All behave the same way.
  • I have tried supplying an explicit fileformat with the save-method. This does not work for the xlsx format (but does for xls and so on).

The code excerpt is as simple as this:

fileName = @“D:\test.xls”
newFileName = @“D:\test.xlsx”
Aspose.Cells.Workbook workbook = new Aspose.Cells.Workbook(fileName);
workbook.Save(newFileName);

What might be going wrong?

Kind Regards
Ingmar van de Beld

@NederlandscheBank,

Thanks for the details.

Could you please share your input XLS file(s) to reproduce the issue, we will check it soon.

Hi Amjad Sahi,

How can i do that in a “private” way? The files do not contain very sensitive data, but certainly not public data. Otherwise i can construct a new test-file with bogus data.

Ingmar

@NederlandscheBank,

I have made your thread “private”. Now you may safely attach your attachments. Now no other users (except you and Aspose staff members) could see or download your attachments. Alternatively, you may create a new file with dummy data and share with us to reproduce the issue.

PS. please zip the file(s) prior attaching.

Thanks Amjad Sahi! I made a .zip file of a newly created 97-2003 excel file with only testdata. Using this file I get the exact same errormessage as before. If convenient you can make the thread public again.

TestBogusData.zip (14.0 KB)

I can supply more files if necessary. One thing to notice: The files are stored in SharePoint. They are downloaded, then converted (which fails for these kind of Excel files) and then uploaded again. I don’t know whether this makes much of a difference, but it might be good to know.

@NederlandscheBank,

Thanks for the template file and further details.

Please notice, I am able to reproduce the issue as you mentioned by converting your template file to XLSX. I found an exception “Item has already been added. Key in dictionary: ‘0ecff379-717b-4ae9-88c8-0d8c4180f00a’ Key being added: ‘0ecff379-717b-4ae9-88c8-0d8c4180f00a’” on saving to XLSX file format. I have logged a ticket with an id “CELLSNET-52493” for your issue. We will look into it soon.

Once we have an update on it, we will let you know.

Thanks a lot already!

@NederlandscheBank,

You are welcome.

@NederlandscheBank,

We are pleased to inform you that your issue has been resolved now. The fix will be included in our upcoming release (Aspose.Cells v23.1) which is scheduled in the second week of January 2023. You will be notified once the next release is published.

The attached files are private by default.
I still sometimes create “private” topics, in case the actual text content of the conversation might contain sensitive details.

@TarasTielkes,

For your information, we set the thread/topic “private” but as @NederlandscheBank asked to make it public again:

so we made this thread public later on.

Since you are not the owner of the thread, so you might not download the attachments in the thread. Anyways, thanks for your comments.

Thanks for the additional explanation about “privateness”! Im looking forward to the update. Many thanks!!

Kind regards,
Ingmar van de Beld

@NederlandscheBank,

You are welcome. Hopefully, we will publish the next release (Aspose.Cells v23.1) in the next week.

The issues you have found earlier (filed as CELLSNET-52493) have been fixed in this update. This message was posted using Bugs notification tool by johnson.shi