I'm using the JExcel API to create an XLS file. I can't figure out how to populate a new cell without any specific cell formatting. I would like the formatting to be automatically applied, as it does in Excel when you type a value in a cell and it auto-detects what it thinks you're trying to enter.
I wrote something similar to this:
import jxl.Workbook;
import jxl.write.Label;
import jxl.write.WritableSheet;
import jxl.write.WritableWorkbook;
WritableWorkbook w = Workbook.createWorkbook(new File(xlsPath));
WritableSheet sheet = w.createSheet("Sheet1", 0);
sheet.addCell(new Label(colNum, rowNum, "99"));
Because I used a 'Label', the value entered in the cell is '99 -- notice the apostrophe in the value, forcing it to be evaluated as a text value. Other potential classes to use are Blank, Boolean, DateTime, Formula, Label, and Number. The problem is that I don't know what type the cell value will be when I'm setting it.
How can I enter my values in the field without knowing the data type, and without the JExcel API prefixing my values with apostrophes?