I use the Perl module Excel::Writer::XLSX. If I enter the function directly in excel under data check it works. The modified form for the Perl script does not work.
I have some sheets in my Excel file. Under 'data validation' -> 'list', I use this as 'source':
=BEREICH.VERSCHIEBEN(Boden_Subtyp!$E:$G;1;VERGLEICH(Profil!$G$2;Boden_Subtyp!$E$1:$G$1;0)-1;ANZAHL2(INDEX(Boden_Subtyp!$E:$G;;VERGLEICH(Profil!$G$2;Boden_Subtyp!$E$1:$G$1;0)));1)
It works.
If I use this in a modified form in my Perl script to create an Excel file with this function so I can't open the Excel file. The modified form:
=BEREICH.VERSCHIEBEN('Boden_Subtyp'!$E:$G;1;VERGLEICH('Profil'!$G$2;'Boden_Subtyp'!$E$1:$G$1;0)-1;ANZAHL2(INDEX('Boden_Subtyp'!$E:$G;;VERGLEICH('Profil'!$G$2;'Boden_Subtyp'!$E$1:$G$1;0)));1)
Code snipped:
$validate_source = "=BEREICH.VERSCHIEBEN('Boden_Subtyp'!$E:$G;1;VERGLEICH('Profil'!$G$2;'Boden_Subtyp'!$E$1:$G$1;0)-1;ANZAHL2(INDEX('Boden_Subtyp'!$E:$G;;VERGLEICH('Profil'!$G$2;'Boden_Subtyp'!$E$1:$G$1;0)));1)";
$profil_zugriffshash -> data_validation(
$iii,$spaltenzaehler,
{
validate => 'list',
source => "$validate_source",
}
);
If the Excel file is created I'll open it with Excel and get the error: excel's unreadable content was found ...
That's not the solution to the problem. I simplify the problem. The script creates a file that Excel can read without errors. If the commented source entry is used, Excel reports an error. However, the commented source entry can be directly exchanged for the uncommented source entry in Excel.