Using Michael's tip and changing 0x90 to 0xFF i can boost the 'limit' to 255 characters but it's still to small I need atleast double, I'll have a look inside the excel.pbi file to see if I can somehow change the character count it writes.
I might have read somewhere that in early versions of excel format you have to write a continue flag if the amount of characters exceeds a certain limit and then write a new cell which continues your previous one. On opening in excel they will be seen as one. Don't know if that's true.
I can't use csv because upon opening it Excel changes the dates, you can't say this cell must be treated as text in csv. I know you can import a csv instead of opening it but that requires to much additional steps for my users and isn't 'foolproof'. A date in csv plaintext like 2005-10-22 get's changed to 22/10/05 depending on country/language settings. Also each Excel version treats newlines different which is annoying.
This is the part the xlsWriteTextprocedure of excel.pbi, maybe it needs a simple change:
Code: Select all
Procedure.l xlsWriteText(value.s, lrow.l, lcol.l, CellFont.l, CellAlignment.l, HiddenLocked.l, CellFormat.l)
;convert the row, col from LONG to INTEGER.
Row.w = ConvertRow(lrow.l)
Col.w = ConvertCol(lcol.l)
Protected b.b
st.s = value
l.l = Len(st)
Protected TEXT_RECORD.tText
TEXT_RECORD\opcode = 4
TEXT_RECORD\length = 10
;Length of the text portion of the record
TEXT_RECORD\TextLength = l.l
;Total length of the record
TEXT_RECORD\length = 8 + l.l
TEXT_RECORD\Row = Row
TEXT_RECORD\col = col
TEXT_RECORD\rgbAttr1 = (HiddenLocked.l) ;CBYT
TEXT_RECORD\rgbAttr2 = (CellFont.l + CellFormat.l)
TEXT_RECORD\rgbAttr3 = (CellAlignment.l)
WriteData(xlsFileNumber,@TEXT_RECORD, SizeOf(TEXT_RECORD))
Debug(SizeOf(TEXT_RECORD))
;Then the actual string data
For a.l = 1 To l.l
b = Asc(Mid(st, a, 1))
WriteData(xlsFileNumber,@b, 1)
Next
ProcedureReturn 0 ;return with no error
EndProcedure
full
here