Forum > FPSpreadsheet

[FPSpreadsheet] Link to a cell in another worksheet. not saved

<< < (2/2)

wp:
Ah maybe something different: Did you add the workbook option to read formulas? Otherwise formulas are ignored altogether...

This is my test program with which I tested my commit:

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---program test;uses  FPSpreadsheet, FPSTypes, FPSExprParser, XLSXOOXML, FPSOpenDocument;const  FILE_NAME = '4.xlsx';//  FILE_NAME = '4-R1C1.xlsx';//  FILE_NAME = '4.ods';//  FILE_NAME = 'link_to_other_sheet.xlsx';var  b: TsWorkbook;  sh: TsWorksheet;  f: PsFormula;begin  b := TsWorkbook.Create;  try    b.Options := [boReadFormulas];    b.ReadFromFile(FILE_NAME);    sh := b.GetFirstWorksheet;    for f in sh.Formulas do      WriteLn(f^.Text);    b.WriteToFile('444.xlsx', sfOOXML, true);  finally    b.Free;  end;   ReadLn;end.

veb86:

--- Quote from: wp on October 09, 2023, 11:57:45 pm ---Ah maybe something different: Did you add the workbook option to read formulas? Otherwise formulas are ignored altogether...

This is my test program with which I tested my commit:

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---program test;uses  FPSpreadsheet, FPSTypes, FPSExprParser, XLSXOOXML, FPSOpenDocument;const  FILE_NAME = '4.xlsx';//  FILE_NAME = '4-R1C1.xlsx';//  FILE_NAME = '4.ods';//  FILE_NAME = 'link_to_other_sheet.xlsx';var  b: TsWorkbook;  sh: TsWorksheet;  f: PsFormula;begin  b := TsWorkbook.Create;  try    b.Options := [boReadFormulas];    b.ReadFromFile(FILE_NAME);    sh := b.GetFirstWorksheet;    for f in sh.Formulas do      WriteLn(f^.Text);    b.WriteToFile('444.xlsx', sfOOXML, true);  finally    b.Free;  end;   ReadLn;end.
--- End quote ---

It worked. Thanks! b.Options := [boReadFormulas]; - was missing from my code. When I created the example, I thought that this was not important for saving.

There is one more bug, it’s not critical for me, but still. Check it out. It corrupts the file. If the sheets are named like this <light><panel>. I made special codenames for work.

there is a new file in the archive

wp:
Fixed in SVN.

veb86:

--- Quote from: wp on October 10, 2023, 01:19:22 am ---Fixed in SVN.

--- End quote ---
It worked. Thank you!!!

Small questions.
Data Validation Worksheet: List. Name ranges. Are these difficult questions? Are they on the roadmap?
Now I can do without them. Just very interesting

wp:

--- Quote from: veb86 on October 10, 2023, 10:21:48 am ---Small questions.
Data Validation Worksheet: List. Name ranges. Are these difficult questions? Are they on the roadmap?

--- End quote ---
I don't know. Once I was close to starting with named cells and ranges, but there was some complication which demotivated me, and I moved this activity aside and forgot it. Glad that there is no roadmap for me...

Navigation

[0] Message Index

[*] Previous page

Go to full version