Lots of PHPExcel example could be found here:
https://github.com/PHPOffice/PHPExcel/tree/develop/ExamplesOn client side I have the following code:
function myButtonClick(){
getFile('phpExcelTest.php',$("#myForm").serialize());
}
function getFile(address,parameters){
$.messager.progress({text:'Processing. Please wait...'});
$.post(address,
parameters,
function(data){
$.messager.progress('close');
if(isNaN(data)==false){
javascript:window.location='getFile.php?p='+data;
} else {
$.messager.alert('ERROR',data);
}
}
);
}
In my case PHP script generates/saves file and sends its integer ID back to getFile function.
If I get integet value than it is OK and I could call for already generated file ohtervise show message from PHP script.
If you 100% sure that your Excel file will be generated without any problems you can call for Excel file directly via "javascript:window.location=" for example