I have a phone number stored in Excel as a String, the Excel file was created successfully, and the data is error free, but each phone number has a “number saved as text” error next to it.
I read online that I have to use a special phone number format, which is included in excel or in a special format 000-000-0000. I can install them using excel, but not from my Java code.
I looked at the information about setCellType and DataFormat, but I assume CellType should be String, and I don’t see how I can use DataFormat for anything but dates.
I also looked at DataFormatter, but I don’t understand how to use it to store data. It appears to be read-only. http://poi.apache.org/apidocs/org/apache/poi/ss/usermodel/DataFormatter.html
How can I do one of the following?
1) Mark the cell as "ignore error" to ignore the error "number saved as text"
2) Use the built-in Excel cell format "Special phone number"
For 1) a flag appears that is saved through the save and close file, I don’t know how to edit or view it using the POI. There is a message about this:
669 670 Excel FeatFormulaErr2, FeatRecord, , " "
: off - 46136-NoWarnings.xls 46136-WithWarnings.xls. !
http://mail-archives.apache.org/mod_mbox/poi-user/201003.mbox/%3C27823222.post@talk.nabble.com%3E
, VBA cell.Errors.Item(xlNumberAsText).Ignore = True, , , POI