How do I create an Excel file? I'm developing a module. I need to give to the users the option to download the coupons in XLS (Excel) format.
How I can do this?
I'm assuming you are using some content type for the content needed on your module.  If so, then you can use Views with a module like Views Data Export.