Recent

Author Topic: [fpspreadsheet] Cannot copy worksheet containing data validation: list  (Read 1943 times)

veb86

  • Jr. Member
  • **
  • Posts: 62
Hello!
When trying to copy a sheet containing a data check (list), the program crashes

Code: Pascal  [Select][+][-]
  1. MyWorkbook := TsWorkbook.Create;
  2. MyWorkbook.ReadFromFile('d:\4.xlsx', sfOOXML);
  3.  
  4. MyWorkbook2 := TsWorkbook.Create;
  5. new_worksheet := MyWorkbook2.CopyWorksheetFrom(MyWorkbook.GetFirstWorksheet, true);
  6. MyWorkbook2.WriteToFile('d:\444.xlsx', sfOOXML);
  7.  

The error refers to "source\common\fpsreaderwriter.pas" line 862

What could be the problem?

wp

  • Hero Member
  • *****
  • Posts: 12459
Re: [fpspreadsheet] Cannot copy worksheet containing data validation: list
« Reply #1 on: September 26, 2023, 11:20:13 am »
Which version of fpspreadsheet are you using? My development version (which is the one you can find at CCR) does not  crash. Note that the version distributed by OPM is a bit behind the CCR version.

But nevertheless, validation lists are not supported by fpspreadsheet and will be lost upon copying even when the application does not crash.

veb86

  • Jr. Member
  • **
  • Posts: 62
Re: [fpspreadsheet] Cannot copy worksheet containing data validation: list
« Reply #2 on: September 26, 2023, 01:07:53 pm »
Which version of fpspreadsheet are you using?
I want to use this library in the ZCAD drawing program (open source).
We work on GitHub and connect this library as a Git submodule. To do this, we made a fork from here https://svn.code.sf.net/p/lazarus-ccr/svn/components/fpspreadsheet
Our fork is here https://github.com/veb86/fpspreadsheet. I plan to regularly keep up-to-date with Sourceforge

But nevertheless, validation lists are not supported by fpspreadsheet and will be lost upon copying even when the application does not crash.
This is very sad. I need to organize several copies of the reference worksheet. I see validation lists as a great convenience. Excel is a powerful calculator and I wanted to select material in it. Maybe you know how to organize your list differently?

 

TinyPortal © 2005-2018