How do I set exported Excel cell format, from "General", to "Text"?
I have cell values with numeric string data (e.g., "0123456789"). When I open the exported Excel file, I want Excel to display the cell format type as "Text". If left as type "General", the Excel export seems to turn the value into scientific notation and/or drops the leading zero.
What I've tried:
1. oSheet.Item(iRowIterator, iColumnIterator).NumberFormat = ExcelFormatType.Text
2. oSheet.Item(iRowIterator, iColumnIterator).NumberFormat = "Text"
Results:
1. Sets NumberFormat to string "2"; Excel export shows format type = "Number" and value displayed as "0123456789.00"
2. Sets NumberFormat to string "Text"; Excel export shows format type = "Number" and value displayed as "0123456789.00"
Thank you
asked 11/13/2018 7:13:05 PM