We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Receiving Argument Out Of Range Exception when Saving certain Worksheets

Hello,

I currently have a user that is receiving the following stack trace when attempting to save certain workbooks. I am working with the users to get a "scrubbed" version of the file for a sample to upload but I was hoping that perhaps someone had seen this before.

Specified argument was out of the range of valid values.
Parameter name: Item xl/customProperty1.bin already exists in the archive
   at Syncfusion.Compression.Zip.ZipArchive.AddItem(String itemName, Stream data, Boolean bControlStream, FileAttributes attributes)
   at Syncfusion.XlsIO.Implementation.XmlSerialization.FileDataHolder.PrepareNewItem(String itemNameStart, String extension, String contentType, RelationCollection relations, String relationType, Int32& itemsCounter, ZipArchiveItem& item)
   at Syncfusion.XlsIO.Implementation.XmlSerialization.Excel2007Serializator.SerializeWorksheetProperty(XmlWriter writer, WorksheetImpl sheet, ICustomProperty property, Int32 counter)
   at Syncfusion.XlsIO.Implementation.XmlSerialization.Excel2007Serializator.SerializeCustomProperties(XmlWriter writer, WorksheetImpl sheet)
   at Syncfusion.XlsIO.Implementation.XmlSerialization.Excel2007Serializator.SerializeWorksheet(XmlWriter writer, WorksheetImpl sheet, Stream streamStart, Stream streamConFormats, Dictionary`2 hashXFIndexes, Stream streamExtCondFormats)
   at Syncfusion.XlsIO.Implementation.XmlSerialization.WorksheetDataHolder.SerializeWorksheetPart(WorksheetImpl sheet, Dictionary`2 hashNewXFIndexes)
   at Syncfusion.XlsIO.Implementation.XmlSerialization.WorksheetDataHolder.SerializeWorksheet(WorksheetImpl sheet, Dictionary`2 hashNewXFIndexes, Dictionary`2 cacheFiles)
   at Syncfusion.XlsIO.Implementation.XmlSerialization.FileDataHolder.SaveWorksheet(WorksheetImpl sheet, String itemName, Dictionary`2 hashNewXFIndexes, Dictionary`2 cacheFiles)
   at Syncfusion.XlsIO.Implementation.XmlSerialization.FileDataHolder.SaveSheet(WorksheetBaseImpl sheet, String itemName, RelationCollection relations, String workbookPath, Dictionary`2 hashNewXFIndexes, Dictionary`2 cacheFiles)
   at Syncfusion.XlsIO.Implementation.XmlSerialization.FileDataHolder.SaveSheets(RelationCollection relations, String workbookItemName, Dictionary`2 hashNewXFIndexes, Dictionary`2 cacheFiles)
   at Syncfusion.XlsIO.Implementation.XmlSerialization.FileDataHolder.SaveWorkbookPart(Dictionary`2 hashNewXFIndexes, Dictionary`2 cacheFiles)
   at Syncfusion.XlsIO.Implementation.XmlSerialization.FileDataHolder.SaveWorkbook(ExcelSaveType saveAsType)
   at Syncfusion.XlsIO.Implementation.XmlSerialization.FileDataHolder.SaveDocument(ExcelSaveType saveType)
   at Syncfusion.XlsIO.Implementation.XmlSerialization.FileDataHolder.SaveDocument(Stream stream, ExcelSaveType saveType)
   at Syncfusion.XlsIO.Implementation.XmlSerialization.FileDataHolder.Serialize(Stream stream, WorkbookImpl book, ExcelSaveType saveType)
   at Syncfusion.XlsIO.Implementation.WorkbookImpl.SaveAsInternal(Stream stream, ExcelSaveType saveType)
   at Syncfusion.XlsIO.Implementation.WorkbookImpl.SaveAs(Stream stream, ExcelSaveType saveType)
   at Syncfusion.XlsIO.Implementation.WorkbookImpl.SaveAs(Stream stream)
   at SyncFusionXlsIOTest3.MainWindow.Button_Click(Object sender, RoutedEventArgs e) in c:\Users\plowrance\Documents\Visual Studio 2012\Projects\SyncFusionXlsIOTest3\SyncFusionXlsIOTest3\MainWindow.xaml.cs:line 51

Any help would be appreciated!

Thanks,

3 Replies

KD Kesavan D Syncfusion Team June 28, 2016 07:34 AM UTC

Hi Paul, 
 
Thank you for contacting Syncfusion support. 
 
We are unable to reproduce the issue from our side. We have tried in different possible scenarios to reproduce the issue but we are unable reproduce it. We have a shared a sample for your reference which can be downloaded from following location. 
 
 
Kindly modify the sample to reproduce the issue and share us the modified sample along with the issue reproducing input files which will be helpful for us to give you a prompt solution at the earliest. 
Please let us know if you have any concerns. 

Regards, 
Kesavan 



PL Paul Lowrance June 28, 2016 03:30 PM UTC

Thank you for the quick response. I am working now to get a file that has sensitive data removed so I can share with you. The code sample you provided returns the same error we are seeing in our application which means it is definitely something in the workbook.


KD Kesavan D Syncfusion Team June 29, 2016 06:46 AM UTC

Hi Paul, 

We have recently fixed a similar type of issue with “ArgumentOutOfRange Exception is thrown on saving workbook with custom properties” in our latest version 14.2v which can be downloaded from following link. 


If you are still facing this issue after upgrading to our latest version then share us the input document which will be helpful for us to provide you a prompt solution at the earliest. 

Please let us know if you have any concerns. 

Regards, 
Kesavan 


Loader.
Up arrow icon