Please provide us with more information. For example, what is the error message?
If you receive the following message: “The file you are trying to open, ‘file_name.xls’, is in a different format than specified by the file extension. Verify that the file is not corrupted and is from a trusted source before opening this file. Do you want to open the file now?”
The reason of this warning message is explained in details in the following post: excel-2007-extension-warning
For ‘xlsx’ export, use the ‘exportview’ method instead.