I respond to myself, the problem is in the template (advaark) since when I change to another template and export, the excel document is downloaded correctly. So what I'm doing is changing my template when I want to export, at least until the problem is solved.
I hope it works for someone
regards