xxxxxxxxxx
// Include the PHPSpreadsheet library autoload file
require 'vendor/autoload.php';
use PhpOffice\PhpSpreadsheet\IOFactory;
// Load the spreadsheet file
$spreadsheet = IOFactory::load('path/to/my/spreadsheet.xlsx');
// Get the active sheet
$sheet = $spreadsheet->getActiveSheet();
// Set the height of a row
$row = 2; // Row number (change as needed)
$height = 20; // Desired row height in points
$sheet->getRowDimension($row)->setRowHeight($height);
// Set the height of a cell
$column = 'A'; // Column letter (change as needed)
$cell = $column . $row; // Cell reference
$height = 25; // Desired cell height in points
$sheet->getStyle($cell)->getFont()->setSize($height);
// Save the modified spreadsheet
$writer = IOFactory::createWriter($spreadsheet, 'Xlsx');
$writer->save('path/to/save/spreadsheet.xlsx');