fjenett / xlsreader-library-processing

a Processing library that can read from .xls (aka. Excel) files
12 stars 5 forks source link

Fix for String error «Cannot get a text value from a error formula cell» #9

Closed timpulver closed 9 years ago

timpulver commented 9 years ago

I got the following error when trying to read a String: IllegalStateException: Cannot get a text value from a error formula cell, the first two Strings could be read well, the third not. I had to add cell.setCellType(1); before s = cell.getRichStringCellValue().toString(); in the function public String getString () as proposed on StackOverflow. Then everything went well…thanks for the lib!

fjenett commented 9 years ago

Hey, this is per design. Reading text from a formula cell (or any other non-text cell) should raise an error … you should fix the Excel file instead i propose.