[Solved] Saving a workbook with multiple local defined names produces a file tha lazarus / 49-FPSpreadsheet ---------------------------------------------------------------------- Kaljakoira · 2026-03-09 12:54 My "Setup": Lazarus 4.6 FPC 3.2.2 fpSpreadsheet CCR version (after r9979-9981) Windows 11 When adding defined names in worksheet everything works ok, both woth global and local names, i can use the names in formulas and all is OK , but when if I add multiple local names and save the file it's somehow corrupted and can not be opened again; ""not a valid spreadsheet file" (Multiple Global names are no problem). I add the local names with: 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 with sWorkbookSource1.Worksheet do  DefinedNames.Add(Name, Index, Index, r1, c1, r2, c2);  What works: - Multiple global names → OK, saves and open without problems - Single local name → OK, saves and opens without problems - Multiple local names → file becomes invalid I have tried to find out wether my code is wrong or if I have forgotten something but no success so far, thanks in advance for any help. A sample of a "corrupt2 testfile as ZIP is attached. ---------------------------------------------------------------------- wp · 2026-03-09 13:44 What do you mean with "multiple"? Just more than one? Or some defined names have equals names? ---------------------------------------------------------------------- Kaljakoira · 2026-03-09 14:31 I mean more than 1 name, no duplicate names but more tnan 1 locsl name on one or more sheets. ---------------------------------------------------------------------- wp · 2026-03-09 16:39 Tiny typo: "i" instead of "j"... Should be fixed now in CCR version. ---------------------------------------------------------------------- Kaljakoira · 2026-03-09 17:06 Thanks for your efforts, I'm not at my computer for the moment but will check tomoorow morning and mark this post as solved once it's cleared ( I suppose it means thst if I download the latest CCR version the matter should be OK ?) ---------------------------------------------------------------------- wp · 2026-03-09 17:46 yes ---------------------------------------------------------------------- Kaljakoira · 2026-03-10 08:09 Works fine now. Thanks for your fast action