sfEXcel8 - only 256 chars in cell when file open in MS Excell lazarus / 49-FPSpreadsheet ---------------------------------------------------------------------- paweld · 2016-02-20 20:05 hi, i try save to cell over 256 chars (file format: sfExcel8): Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TForm1.XLStest;var  s256, s512: String;  workbook: TsWorkbook;  worksheet: TsWorksheet;begin  s256:='Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam vel maximus quam. '+        'Nulla magna ex, pellentesque sed mauris vel, venenatis egestas nisi. In pharetra cursus tincidunt.'+        'Nam sit amet dui suscipit, luctus erat non, fringilla orci. Quis --256 END';  s512:='Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam vel maximus quam. '+        'Nulla magna ex, pellentesque sed mauris vel, venenatis egestas nisi. In pharetra cursus tincidunt. '+        'Nam sit amet dui suscipit, luctus erat non, fringilla orci. Quisque et diam et leo pulvinar mollis. '+        'Phasellus sit amet ultricies magna. Fusce suscipit turpis vel malesuada dictum. '+        'Duis ac fermentum enim, vitae volutpat magna. '+        'Phasellus blandit, libero sit amet porta pretium, justo quam interdum diam, sit amet pretium s --512 END';  workbook:=TsWorkbook.Create;  worksheet:=workbook.AddWorksheet('Test');  worksheet.WriteText(0, 0, s256);  worksheet.WriteText(0, 1, s512);  workbook.WriteToFile('test.xls', sfExcel8, True);  workbook.Free;end;  MS Excel show only 256 chars in B1 cell, LibreOffice Calc show all ok. if file format is sfOOXML, in excel and cals it's ok. ---------------------------------------------------------------------- wp · 2016-02-20 21:35 Ha - that's fun! I looked at the binary contents of the file - the string in cell B1 is stored completely up to its end, i.e. 512 characters. I opened the file in LibreOffice Calc - there are 512 characters again. I openend the file in fpspreadsheet's demo_ctrls - there are 512 characters. I openend the file in Excel2007 - there are 256 characters only! Finally I remembered my old Office 97 on a Win2000-VM - 512 characters again (except for the last one - see screenshot). Interestingly, if I create a 512-char string in Excel2007 (by appending the 256-char string to itself) and save this as xls, then Excel displays the full string if the file is reopened in Excel. Looking at this file with the BIFFExplorer I see that this string is stored in a Shared-string-table. fpspreadsheet, on the other hand, writes the string directly to the cell. Therefore, there seems to be a limitation of Excel to truncate LABEL cells after 256 characters, but to leave shared-strings alone. Is this a serious limitation for you? Can't you store in xlsx or ods format? ---------------------------------------------------------------------- paweld · 2016-02-20 23:54 Thanks to your answer. Curently i export data to xlsx format.