OMG! I suspected that it was my mistake! As always, the ridiculous typo slowed down the work for several hours. Thank you! Now, after changing the order of the parameters, the function works correctly on all sheets.
I also thank you for solving the second problem - it works. It is a pity that this construction is not singled out in a separate method - something like a RePaint. But as my previous President joked - "He can do everything, but he cannot do everything at once"
I know that the questions asked in the first message received their comprehensive answers. However, I will not close this discussion yet (Solved). I deliberately put into the title of the topic several titles of various methods that are widely used in spreadsheet processors. I would like to discuss their creation here, in this thread. Everything that will be accumulated as a result of the discussion may be transferred to the package code — it is easier to assemble code fragments from one topic than to collect from several. If I'm wrong - correct me, I'll start a new topic.
When processing tables, rectangular data ranges, such things are actively used (I quote the method names from StarBasic AOO/LiO) - queryEmptyCells, queryIntersection, getData (result as array of arrayof Double), getDataArray (...of Variant), copyRange, etc.
If we can manage to implement some of these features, using FPSpreadsheet will become even easier. The next method I want to think about is getDataArray. In Excel it replaces with
I want to know your opinion on the implementation of this method. Should I read the worksheet, I double loop row by row and cell by cell? Or does it make sense to think about cutting a tree of cells from the upper left corner and bypassing the resulting subtree with the restriction to the extreme right index (column) and lower? The first method (high level) relies on already existing methods of reading cells, but it will be slow because of the piece-by-piece reading of each cell. The second method (low level) will require intervention in the parent classes, which contradicts some of the principles, can lead to errors and confusion. But must be very fast. Your opinion?