tealeg / xlsx

Go library for reading and writing XLSX files.
Other
5.85k stars 819 forks source link

Can detect type when raw cell type is empty, instead of "Numberic" by default? #807

Closed someblue closed 1 month ago

someblue commented 3 months ago

Thanks for the awesome library! It saved my time a lot! I find an issue with the default cell type behaviour.

I have a system generated xlsx file containing a formula cell type.

image

It's ok in Microsoft Excel. But using tealeg/xlsx, cell. FormattedValue() return str="", err=nil. Expected return str="I18N", err=nil as in excel.

After debugging, I found that the raw cell has no type information for the cell. And then by default, the type will be treated as "numberic", so the formula are ignored when parsing.

image

Maybe the system generates the xlsx file incorrectly, but I cannot contact with the admin of system to change the behaviour. And it work well in Microsoft Excel.

Is it possible to change the default behaviour: check if the rawCell.F exists, set type as "Formula" if so?

github-actions[bot] commented 1 month ago

Stale issue message