You may saw before the article Create XLSX/MHTML file from internal table in background and you may have use it without any issues before, but it seems that in newer releases of SAP (definitelly >= 7.50) this way makes corrupted XLSX files.
So I've rechecked again how it is done in ALV grid in the new NW releases and I've updated the code, so now the issue with corrupted file is solved.
The mothod is simplified as much as possible at the moment, at the end all you must pass to a method is your internal table, but you can also pass sorting, filter and layout criteria using ALV grid structures.
The definition of the method should look like this:
it_fieldcat type lvc_t_fcat optional
it_sort type lvc_t_sort optional
it_filt type lvc_t_filt optional
is_layout type lvc_s_layo optional
it_hyperlinks type lvc_t_hype optional
value(itdata) type standard table
returning value(r_xstring) type xstring.