Start by downloading a file from your code that contains a small amount of data.
Then create an Excel sheet that contains the same data and save it as an XLSX file (using Excel 2010)
Then use an editor to compare the two files: The Excel generated one will be unreadable binary data, make sure the one you generate is similar.
XLSX files are Zipped files, which is why they are unreadable.
Now change the extension on both files to .ZIP and open them again: this time you should be able to see a files list like this:
_rels (a folder)
docProps (a folder)
xl (a folder)
Again, the two should be the same or at least very similar.
Continue checking until you find a major difference, and you can start wori=king out from there what is wrong about your data.
Sorry, but we can't do any of that for you!