What are common pitfalls when using the PHP Spreadsheet Excel Writer for Excel exports?

One common pitfall when using the PHP Spreadsheet Excel Writer for Excel exports is not properly setting the content type header before outputting the Excel file. This can result in a corrupted file or unexpected behavior when opening the Excel file. To solve this issue, make sure to set the content type header to "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" before outputting the Excel file.

header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');