fpspreadsheet, How to write text on a merge cell? lazarus / 49-FPSpreadsheet ---------------------------------------------------------------------- incendio · 2024-09-02 09:40 Hi guys I have this codes 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  function TMainFrm.RptRcvDOC(RptNm : string) : string;var  WB        : TsWorkbook;  WS        : TsWorksheet;  FNm       : string;  FrmN      : string; begin  try    WB := TsWorkbook.Create;    WB.ReadFromFile('XLFiles.xlsx');    WS := WB. ActiveWorksheet;    FrmN := GetFrmN(RptNm);    FNm := 'XL' + FrmN + '.xlsx';     WS.WriteText(3,5,FrmN);    WS.WriteText(6,24,'Test');     WB.WriteToFile(FNm,true);    OpenDocument(FNm);    Result := 'OK';   except on E: Exception do  begin    Result := E.Message;  end;  WB.Free;  Result := 'OK';end;  This code : WS.WriteText(6,24,'Test'), write to a merge cell, attached is a sample xl file. It didn't work. If it was not a merge cell, worked OK. Any hints, how to solved this problem? PS : Lazarus 2.2.2, fpspreadsheet 1.14.0.0, on Windows 10. ---------------------------------------------------------------------- wp · 2024-09-02 10:37 Text as well as formatting of merged cells is taken from the top/left cell of the merged block. The merged block in your test file that you probably mean, however, does not begin at column 24, but at column 23 (row and column indices in FPSpreadsheet are 0-based, in Excel 1-based) ---------------------------------------------------------------------- incendio · 2024-09-02 12:01 You were right. On a row before a merge cell , text was written at column 24. So, on a merge cell, I repeated write to column 24 instead of column 23, really missed that. Thanks for your help 👍