Script side, i don't think there is a way to store to excel...
You can do it by macro on post reload event or maybe you can store in the script in csv with a statemenet something like that
Store Source into Source_new.txt (txt);
check out this conversation: Store in Excel
Hi, just do it like this
FROM [lib://<your path>]...;
For each region in FieldValueList('region')
FROM [lib://<your path>]...
Store Data into [lib://<your path>\<your file name>-'$(region)'.csv] (txt);
drop table [your_table];
Don't forget !
When applicable please mark the appropriate replies as CORRECT https://community.qlik.com/docs/DOC-14806. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads as HELPFUL if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads as HELPFUL if you feel additional info is useful to others.