Posted 20 June 2024, 12:55 am EST
Running test code with the GC excel components - they fail to open newer versions of excel docs.
The exception received is:
OpenTest
Duration: 149 ms
Message:
Test method XlsxTest.OpenTest threw exception:
GrapeCity.Documents.Excel.alw: Unexpected character encountered while parsing value: P. Path '', line 0, position 0.
Stack Trace:
amc.ac()
amc.yx()
xj.ag(buo a, amc b, Dictionary`2 c, List`1 d, Dictionary`2 e, List`1 f, List`1 g, List`1 h, List`1 i, List`1 j, Dictionary`2 k, Dictionary`2 l, Int32& m, we n, IList`1 o)
xj.ad(buo a, Stream b, IList`1 c)
Workbook.FromJson(Stream stream, DeserializationOptions deserializationOptions)
Workbook.am(String a, DeserializationOptions b)
Workbook.Open(String fileName, DeserializationOptions deserializationOptions)
The code used for the test:
string filename = @"C:\temp\pristine.xlsx";
string key = "YOUR KEY HERE";
var sourceWorkbook = new Workbook(key);
sourceWorkbook.Open(filename, new DeserializationOptions
{
IgnoreStyle = true,
DoNotRecalculateAfterLoad = true,
});
I attach a default excel file with no changes in it that should allow you to replicate the test.
We have this working with older more complicated excel files that were made with older versions of excel.
The version of GC I’m using is 7.1.3 on a .NET Core 7.0 project