I am trying to export barcodes to an excel sheet using SpreadsheetAddRow.
Being that barcodes are strings of numbers, the SpreadsheetAddRow seems to automatically interpret the string as a number.. e.g.,
Barcode = 0194112066037
In excel it gets returned as 1.94112E+11 (as datatype General)
In excel it gets returned as 194112066037 (without the '0' preceding the string) (as datatype Number).
In excel it again gets returned as 1.94112E+11 (as datatype Text).
It seems that Excel shouldn't alter any value in a datatype text field.
It's very strange. Especially considering we have not run into this issue when using SpreadsheetAddRows.
ColdFusion Server Developer 2016,0,11,314546
<cfset strXLS = "C:\Example.xls">
<cfset objSheet = SpreadsheetNew(" Export")>
<cfset strBarcode1 = 0194112066037>
<cfset strBarcode2 = 0194112066037>
<cfspreadsheet action="write" filename="#strXLS#" name="objSheet" sheetname="Example" overwrite=true >
This is going to sound strange, but I've experienced something similar a while ago. I learned by myself that if I formatted the cell both before and after setting cell value, it cleared up my issue. Give that a shot. Meanwhile, sometime tomorrow I can take a closer look.
^ _ ^