Quantcast
Channel: ClosedXML - The easy way to OpenXML
Viewing all articles
Browse latest Browse all 1877

Commented Issue: WorkBook opening exception [8506]

$
0
0
When I trying to open workbook I catch exception.
Code:
using (var mem = new MemoryStream())
{
mem.Write(document.DocumentByteArray, 0, document.DocumentByteArray.Length);
using (XLWorkbook wb = new XLWorkbook(mem))

System.ArgumentException was unhandled
Message=An item with the same key has already been added.
Source=mscorlib
StackTrace:
at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
at ClosedXML.Excel.XLWorkbook.LoadAutoFilterColumns(AutoFilter af, XLAutoFilter autoFilter)
at ClosedXML.Excel.XLWorkbook.LoadAutoFilter(AutoFilter af, XLWorksheet ws)
at ClosedXML.Excel.XLWorkbook.LoadSpreadsheetDocument(SpreadsheetDocument dSpreadsheet)
at ClosedXML.Excel.XLWorkbook.LoadSheets(Stream stream)
at ClosedXML.Excel.XLWorkbook.Load(Stream stream)
at ClosedXML.Excel.XLWorkbook..ctor(Stream stream, XLEventTracking eventTracking)
at EPAM.USPS.DocumentProcessor.Masha.Parsers.Excel.ExcelParser.Parse(SmlDocument document) in d:\EPM-USPP\epm-uspp11\EPAM.USPS.DocumentProcessor\Masha\Parsers\Excel\ExcelParser.cs:line 77
at EPAM.USPS.DocumentProcessor.Masha.QuestionnaireParserManager.ParseT[T](T document) in d:\EPM-USPP\epm-uspp11\EPAM.USPS.DocumentProcessor\Masha\QuestionnaireParserManager.cs:line 53
at EPAM.USPS.DocumentProcessor.Masha.QuestionnaireParserManager.Parse(OpenXmlPowerToolsDocument document) in d:\EPM-USPP\epm-uspp11\EPAM.USPS.DocumentProcessor\Masha\QuestionnaireParserManager.cs:line 39
at EPAM.USPS.DocumentProcessor.Tests.DocProcessor.ParseWithTemplate() in d:\EPM-USPP\epm-uspp11\EPAM.USPS.DocumentProcessor.Tests\Programcs.cs:line 64
at EPAM.USPS.DocumentProcessor.Tests.Program.Main(String[] args) in d:\EPM-USPP\epm-uspp11\EPAM.USPS.DocumentProcessor.Tests\Programcs.cs:line 25
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:
Comments: Hi, i have the same issue. Actualy, with the file i'm trying to use, sometimes it works, sometimes not. But i have no idea of the reason. What do you mean by Custom Worksheet ? I noticed that when i change a Celle value from ClosedXML, the new time i want to open triggers this Error. I then open the file in excel and click save; then it works. I attached another file that i try to use, which does not work at all (always have this error on open). Could you tell me if there is something wrong ? Thank you for your help, i'm really strugling with this for a few days

Viewing all articles
Browse latest Browse all 1877

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>