Based on the following example of codedrinks to create an excel file with data that I bring from BD I can get everything right, the excel is created and I can open it without problems, the sample code has a unique
require_once 'lib/PHPExcel/PHPExcel.php';
which is the call to the library in question, but for example, if I add another sentence of this type (include, include_once, reuire, etc.), in my case,
include("global.php");
The created file is downloaded only when it is opened showing the following error
Excel can not open the file [ file name ] because the format or the extension of this are not valid. Check that the file it has not been damaged and that the extension of it matches the format of the file.
This only happens when I add a include
or any sentence of this type, and it seems illogical to me that you can not add a call to a file other than that of the PHPExcel library.