System.InvalidOperationException: formula in specified cell contains errors, correct the formula firstly
retsyo opened this issue · comments
The simple code just do reoGridControl1.Load(fn)
. For one of my excel's xlsx file, reogrid works and loads sheets without problem. But for another xlsx file, I recieved
[2022/11/5 19:22:05] resource pool: create resource pool...
[2022/11/5 19:22:05] resource pool: create resource pool...
[2022/11/5 19:22:06] resource pool: font family error: kaiti_GB2312: can't find font “kaiti_GB2312”。
[2022/11/5 19:22:06] resource pool: font resource group added. font groups: 1
...
[2022/11/5 19:22:06] resource pool: font family error: kaiti_GB2312: can't find font “kaiti_GB2312”。
System.InvalidOperationException: formula in specified cell contains errors, correct the formula firstly
in unvell.ReoGrid.Formula.FormulaRefactor.Reuse(Worksheet sheet, CellPosition fromPosition, RangePosition toRange)
in unvell.ReoGrid.IO.OpenXML.ExcelReader.LoadWorksheet(IWorkbook rgWorkbook, Document doc, WorkbookSheet sheetIndex)
in unvell.ReoGrid.IO.OpenXML.ExcelReader.ReadStream(IWorkbook rgWorkbook, Stream stream)
in unvell.ReoGrid.IO.ExcelFileFormatProvider.Load(IWorkbook workbook, Stream stream, Encoding encoding, Object arg)
in unvell.ReoGrid.Workbook.Load(Stream stream, FileFormat fileFormat, Encoding encoding)
in unvell.ReoGrid.Workbook.Load(String path, FileFormat fileFormat, Encoding encoding)
in unvell.ReoGrid.ReoGridControl.Load(String path, FileFormat fileFormat, Encoding encoding)
in unvell.ReoGrid.ReoGridControl.Load(String path)
Sorry, since the excel file is a private file, I can't attach it here. I know it is hard to tell the reason if I does not supply a sample file, but is there a way to let reogrid say which formula is bad?
I know nothing about C# and do not know how to compile reogrid from source, so a debug version of unvell.ReoGrid.dll, which can display which formula is processing, is appreciated
Sorry again, the code is simple and is in pythonnet
import clr
import sys
clr.AddReference('System.Windows.Forms')
clr.AddReference('System.Drawing')
from System.Drawing import Point
from System.Windows.Forms import Form
sys.path.append(r'C:\tmp\unvell.ReoGrid')
clr.AddReference('unvell.ReoGrid')
from unvell.ReoGrid import *
form = Form()
form.Width = 600
form.Height = 500
reoGridControl1 = ReoGridControl()
reoGridControl1.Location = Point(5, 5)
reoGridControl1.Width = form.Width - 20
reoGridControl1.Height = form.Height - 60
form.Controls.Add(reoGridControl1)
fn = r'c:\tmp\unvell.ReoGrid\working_one.xlsx'
#~ fn = r'c:\tmp\unvell.ReoGrid\not_working_one.xlsx'
reoGridControl1.Load(fn)
form.ShowDialog()
thanks
System.InvalidOperationException: formula in specified cell contains errors, correct the formula firstly
The exception says that there is incorrect formula in the cell, can you please find out the formula and post here?
I have simplified my excel file which can be opened by MS Excel without incorrect formula rendering. In other words, I can't find out the wrong formula, so I attached the file here.
not_working_one.xlsx
Could ReoGrid display which cell on which sheet has bad formula, or could ReoGrid render excel file even there is bad formula just like Excel does?
thanks
any news?