Replies: 4 comments
-
|
I am having trouble understanding your log messages. At the top, it complains that you aren't on Php ^8.1, but near the bottom it says you are on Php 8.5. What version of Php are you using? Even so, your stack trace indicates that you were trying to add a named range to a worksheet? How did you allocate the worksheet in the first place? Are you trying to run your script from the command line or from wampserver? Is there a reason for you to specify --prefer-source? If that is important, is there a reason you cannot put git in your path? |
Beta Was this translation helpful? Give feedback.
-
|
See below in red.
Met vriendelijke groeten
Jan
***@***.***
Op zo 14 dec 2025, 16:16 schreef oleibman ***@***.***>:
I am having trouble understanding your log messages. At the top, it
complains that you aren't on Php ^8.1, but near the bottom it says you are
on Php 8.5. What version of Php are you using
*It's 8.5. I interpret the ^ as 8.1 or higher.*
Even so, your stack trace indicates that you were trying to add a named
range to a worksheet? How did you allocate the worksheet in the first place?
*$spreadsheet = new Spreadsheet();*
*$wsPartijen = $spreadsheet->getActiveSheet()->setTitle('Partijen');*
*and a lot of uses*
* use PhpOffice\PhpSpreadsheet\Spreadsheet;*
* use PhpOffice\PhpSpreadsheet\Writer\Xlsx;*
* use PhpOffice\PhpSpreadsheet\NamedRange;*
* use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet;*
* use PhpOffice\PhpSpreadsheet\Cell\DataType;*
* use PhpOffice\PhpSpreadsheet\Calculation\Calculation;*
* use PhpOffice\PhpSpreadsheet\Style\Fill;*
* use PhpOffice\PhpSpreadsheet\Style\Protection;*
* use PhpOffice\PhpSpreadsheet\Cell\Coordinate;*
* use PhpOffice\PhpSpreadsheet\Cell\Hyperlink;*
* use PhpOffice\PhpSpreadsheet\DefinedName;*
* use PhpOffice\PhpSpreadsheet\Reader\Security\XmlScanner;*
* use PhpOffice\PhpSpreadsheet\Reader\Xlsx\AutoFilter;*
* use PhpOffice\PhpSpreadsheet\Reader\Xlsx\Chart;*
* use PhpOffice\PhpSpreadsheet\Reader\Xlsx\ColumnAndRowAttributes;*
* use PhpOffice\PhpSpreadsheet\Reader\Xlsx\ConditionalStyles;*
* use PhpOffice\PhpSpreadsheet\Reader\Xlsx\DataValidations;*
* use PhpOffice\PhpSpreadsheet\Reader\Xlsx\Hyperlinks;*
* use PhpOffice\PhpSpreadsheet\Reader\Xlsx\Namespaces;*
* use PhpOffice\PhpSpreadsheet\Reader\Xlsx\PageSetup;*
* use PhpOffice\PhpSpreadsheet\Reader\Xlsx\Properties as PropertyReader;*
* use PhpOffice\PhpSpreadsheet\Reader\Xlsx\SharedFormula;*
* use PhpOffice\PhpSpreadsheet\Reader\Xlsx\SheetViewOptions;*
* use PhpOffice\PhpSpreadsheet\Reader\Xlsx\SheetViews;*
* use PhpOffice\PhpSpreadsheet\Reader\Xlsx\Styles;*
* use PhpOffice\PhpSpreadsheet\Reader\Xlsx\TableReader;*
* use PhpOffice\PhpSpreadsheet\Reader\Xlsx\Theme;*
* use PhpOffice\PhpSpreadsheet\Reader\Xlsx\WorkbookView;*
* use PhpOffice\PhpSpreadsheet\ReferenceHelper;*
* use PhpOffice\PhpSpreadsheet\RichText\RichText;*
* use PhpOffice\PhpSpreadsheet\Settings;*
* use PhpOffice\PhpSpreadsheet\Shared\Date;*
* use PhpOffice\PhpSpreadsheet\Shared\Drawing;*
* use PhpOffice\PhpSpreadsheet\Shared\File;*
* use PhpOffice\PhpSpreadsheet\Shared\Font;*
* use PhpOffice\PhpSpreadsheet\Shared\StringHelper;*
* use PhpOffice\PhpSpreadsheet\Style\Color;*
* use PhpOffice\PhpSpreadsheet\Style\Font as StyleFont;*
* use PhpOffice\PhpSpreadsheet\Style\NumberFormat;*
* use PhpOffice\PhpSpreadsheet\Style\Style;*
* use PhpOffice\PhpSpreadsheet\Style\Alignment;*
* use PhpOffice\PhpSpreadsheet\Style\Border;*
* use PhpOffice\PhpSpreadsheet\Worksheet\HeaderFooterDrawing;*
*I have send you my code before.*
Are you trying to run your script from the command line or from wampserver?
*Wamp and later production*
Is there a reason for you to specify --prefer-source? If that is
important, is there a reason you cannot put git in your path?
*It's the command you have given me some years ago*
… —
Reply to this email directly, view it on GitHub
<#4747 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AYABA7E5RYT2NORFKE4UDGD4BV5NZAVCNFSM6AAAAACO7QQAI6VHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTKMRVGE4TKNY>
.
You are receiving this because you authored the thread.Message ID:
***@***.***
com>
|
Beta Was this translation helpful? Give feedback.
-
|
Next time, skip --install-source. That's not the cause of your problem, but it isn't helping. Sorry I gave you bad advice about it some years ago. |
Beta Was this translation helpful? Give feedback.
-
|
SInce you are seeing your failure under wamp, I would like to see how it does on the command line. I would also like you to start clean. Run your |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I composed to release version with command
"composer require --prefer-source phpoffice/phpspreadsheet"
With a lot of messages
Cannot use phpoffice/phpspreadsheet's latest version 5.3.0 as it requires php ^8.1 which is not satisfied by your platform.
./composer.json has been created
Running composer update phpoffice/phpspreadsheet
Loading composer repositories with package information
Updating dependencies
Lock file operations: 12 installs, 0 updates, 0 removals
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 12 installs, 0 updates, 0 removals
Failed to download myclabs/php-enum from source: git was not found in your PATH, skipping source download
Now trying to download from dist
Failed to download psr/simple-cache from source: git was not found in your PATH, skipping source download
Now trying to download from dist
Failed to download psr/http-message from source: git was not found in your PATH, skipping source download
Now trying to download from dist
Failed to download psr/http-factory from source: git was not found in your PATH, skipping source download
Now trying to download from dist
Failed to download psr/http-client from source: git was not found in your PATH, skipping source download
Now trying to download from dist
Failed to download markbaker/matrix from source: git was not found in your PATH, skipping source download
Now trying to download from dist
Failed to download markbaker/complex from source: git was not found in your PATH, skipping source download
Now trying to download from dist
Failed to download symfony/polyfill-mbstring from source: git was not found in your PATH, skipping source download
Now trying to download from dist
Failed to download maennchen/zipstream-php from source: git was not found in your PATH, skipping source download
Now trying to download from dist
Failed to download ezyang/htmlpurifier from source: git was not found in your PATH, skipping source download
Now trying to download from dist
Failed to download composer/pcre from source: git was not found in your PATH, skipping source download
Now trying to download from dist
Failed to download phpoffice/phpspreadsheet from source: git was not found in your PATH, skipping source download
Now trying to download from dist
6 package suggestions were added by new dependencies, use
composer suggestto see details.Generating autoload files
4 packages you are using are looking for funding.
Use the
composer fundcommand to find out more!No security vulnerability advisories found.
Using version ^1.30 for phpoffice/phpspreadsheet
php is version 8.5
move the vendor to test with wamp
I Added the line:
require_once $_SERVER['DOCUMENT_ROOT'] . '/php/php2excel/vendor/autoload.php';to my createExcelFile.php.error Fatal error: Uncaught Error: Call to undefined method PhpOffice\PhpSpreadsheet\Worksheet\Worksheet::addNamedRange() in D:\drive\Jan\Documenten\WebSites\one\janr.be\httpd.www\schaak\excel.php:208 Stack trace: #0 D:\drive\Jan\Documenten\WebSites\one\janr.be\httpd.www\schaak\excel.php(448): doPartijen(Object(PhpOffice\PhpSpreadsheet\Worksheet\Worksheet)) #1 {main} thrown in D:\drive\Jan\Documenten\WebSites\one\janr.be\httpd.www\schaak\excel.php on line 208
Beta Was this translation helpful? Give feedback.
All reactions