I struggled with this for a while, but thought I'd post this in case anyone runs into the same issue.
On LOCALHOST all worked fine for the code below, but when I migrated it to my production website which is HTTPS (secure), the browser would not open the generated Excel file.
I added the following to the top of my PHP script and it now is successfully opening the file in production.
session_cache_limiter('public_no_cache'); // ADDED THIS TO THE VERY TOP OF SCRIPT
// Redirect output to a client’s web browser (Excel2007)
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');