AA formulas are incorrectly handled lazarus / 49-FPSpreadsheet ---------------------------------------------------------------------- jollytall · 2022-04-08 09:49 Wp, I found another, - I guess, - bug. Take a very simple spreadsheet (made in e.g. OpenOffice Calc) with cells used after column Z. E.g. I have A1 := 1, B1 := 2, etc. upto AC1 := 29. Then in A2 := =+A1, etc. AC2 := =+AC1; Then run the following program: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 program project1;{$mode objfpc}{$H+}uses  sysutils,  fpsTypes, fpspreadsheet, fpsopendocument; var  WB : TsWorkbook;beginWB := TsWorkbook.Create;WB.Options := WB.Options + [boReadFormulas];WB.ReadF romFile('test.ods');WB.WriteToFile('test2.ods');WB.Free;end.  The new file has formulas right upto Z2, but AA2 == +A1, AB2 == +B1 and AC2 == +C1. I guess it is wrong when the formula is read from the file, but not sure. Can you have a look at it? Thanks, ---------------------------------------------------------------------- wp · 2022-04-08 10:57 Ooops... Fixed in CCR. ---------------------------------------------------------------------- jollytall · 2022-04-08 13:58 Sorry for my - so-far - non-usage of svn. How can I get the latest version (or what lines shall I change)? ---------------------------------------------------------------------- wp · 2022-04-08 14:28 Download the zipped snapshot from https://sourceforge.net/p/lazarus- ccr/svn/HEAD/tree/components/fpspreadsheet/ and install it manually. Or load the following files and apply the following modifications: source/common/fpexprparser.pasfunction TsExpressionScanner.DoCellRangeODS: add "val := 0;" at the topin "case C of 'A'..'Z'" replace "val := val*10 + ord(C) - ord('A');" by "val := val*26 + ord(C) - ord('A') + 1;" (in words: multiply by 26 rather than by 10, and add 1 to the expression. in '"case C of 'a'..'z'" replace "val := val*10 + ord(C) - ord('a');" by "val := val*26 + ord(C) - ord('a') + 1;"in "case C of '0'..'9'" replace "FCellRange.Col1 := val;" by "FCellRange.Col1 := val - 1;" (in words: subtract 1 from value)in "case c of '0'..'9'" replace FCellRange.Col2 := val;" by "FCellRange.Col1 := val - 1;"source/common/fpsutils.pas in the nested function "Scan" of "function ParseCellString(const AStr: String; out ACellRow, ACellCol: Cardinal; out AFlags: TsRelFlags)" add "ACellCol := 0;" at the top. ---------------------------------------------------------------------- jollytall · 2022-04-08 16:15 Thanks, I think it works, though I could not fully test it due to another error (see next Post).