Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An error occurs when running package.Workbook On a particular workbook #1652

Open
minren118 opened this issue Oct 23, 2024 · 4 comments
Open
Labels
bug Something isn't working

Comments

@minren118
Copy link

EPPlus usage

Noncommercial use

Environment

Windows

Epplus version

7.4.1.1067

Spreadsheet application

Excel365

Description

Another strange problem, running package.Workbook gives an error, but opening it on Excel shows no error at all

even use the newest develop version return error

System.ArgumentException
HResult=0x80070057
Message=已添加了具有相同键的项。
Source=mscorlib
StackTrace:
at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
at System.Collections.Generic.Dictionary2.Insert(TKey key, TValue value, Boolean add) at OfficeOpenXml.RichData.ExcelRichValueStructureCollection.ReadXml(Stream stream) at OfficeOpenXml.RichData.ExcelRichValueStructureCollection.LoadPart(ExcelWorkbook wb) at OfficeOpenXml.RichData.ExcelRichValueStructureCollection..ctor(ExcelWorkbook wb) at OfficeOpenXml.RichData.ExcelRichData..ctor(ExcelWorkbook wb) at OfficeOpenXml.ExcelWorksheet.GetErrorFromMetaData(MetaDataReference md, Object v) at OfficeOpenXml.ExcelWorksheet.SetValueFromXml(XmlReader xr, String type, Int32 styleID, Int32 row, Int32 col) at OfficeOpenXml.ExcelWorksheet.LoadCells(XmlReader xr) at OfficeOpenXml.ExcelWorksheet.CreateXml() at OfficeOpenXml.ExcelWorksheet..ctor(XmlNamespaceManager ns, ExcelPackage excelPackage, String relID, Uri uriWorksheet, String sheetName, Int32 sheetID, Int32 positionID, Nullable1 hide)
at OfficeOpenXml.ExcelWorksheets..ctor(ExcelPackage pck, XmlNamespaceManager nsm, XmlNode topNode)
at OfficeOpenXml.ExcelWorkbook.get_Worksheets()
at OfficeOpenXml.ExcelWorkbook.GetDefinedNames()
at OfficeOpenXml.ExcelPackage.get_Workbook()
at ConsoleApp2.Program.Main(String[] args) in Program.cs:line 49

packageworkbookerror.xlsx

image

@minren118 minren118 added the bug Something isn't working label Oct 23, 2024
@JanKallman
Copy link
Contributor

This file contains an undocumented error type, that causes this issue. :

<s t="_error">
<k n="errorType" t="i"/>
<k n="propagated" t="b"/>
<k n="ptg" t="i"/>
</s>

Was this file created using Excel?

@minren118
Copy link
Author

Yes, I just use EPPLUS to read and write data, most of the template content is processed by Excel.

@JanKallman
Copy link
Contributor

Ok, I cant find any documentation of this error type...https://learn.microsoft.com/en-us/openspecs/office_standards/ms-xlsx/2c5dee00-eff2-4b22-92b6-0738acd4475e.
We will rewrite the handling of rich data in EPPlus 8, so we will look at this as part of that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants
@JanKallman @minren118 and others