Recent

Author Topic: [Solved] Saving a workbook with multiple local defined names produces a file tha  (Read 1257 times)

Kaljakoira

  • New member
  • *
  • Posts: 7
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][+][-]
  1. with sWorkbookSource1.Worksheet do
  2.   DefinedNames.Add(Name, Index, Index, r1, c1, r2, c2);
  3.  

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.
« Last Edit: March 10, 2026, 09:08:51 am by Kaljakoira »

wp

  • Hero Member
  • *****
  • Posts: 13491
What do you mean with "multiple"? Just more than one? Or some defined names have equals names?

Kaljakoira

  • New member
  • *
  • Posts: 7
I mean more than 1 name, no duplicate names but more tnan 1 locsl name on one or more sheets.

wp

  • Hero Member
  • *****
  • Posts: 13491
Tiny typo: "i" instead of "j"... Should be fixed now in CCR version.

Kaljakoira

  • New member
  • *
  • Posts: 7
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

  • Hero Member
  • *****
  • Posts: 13491

Kaljakoira

  • New member
  • *
  • Posts: 7
Works fine now. Thanks for your fast action :)

 

TinyPortal © 2005-2018