PHP Spreadsheet – work on shared hosting?-ThrowExceptions

Exception or error:

I would like to add the Spreadsheet library to my project. I am using Netbeans that are connected to my shared hosting and when I am saving a file, it’s uploading automatically to the server. I can’t add Composer to the server while it is a shared hosting package. When I instantiate the Spreadsheet class:

$spreadsheet = new Spreadsheet();
$sheet = $spreadsheet->getActiveSheet();
$sheet->setCellValue('A1', 'Hello World !');

$writer = new Xlsx($spreadsheet);
$writer->save('hello world.xlsx');

I receive that error:

PHP Fatal error: Call to undefined method Spreadsheet::getActiveSheet()

Somebody could tell me any solution to work with?

How to solve:

Leave a Reply

Your email address will not be published. Required fields are marked *