From: Jerry Chen on
I recommand you to use a excel component, I use from last year, quit good.
http://www.e-iceblue.com/Introduce/excel-for-net-introduce.html
"JohnE" wrote:

> Hello. I am exporting a gridview to excel 2007. I am using the xlsx
> extension in the export code. But, when it asks for open or save, I will get
> the following error when trying to open the spreadsheet from either method.
> The error reads,
>
> "Excel cannot open the file 'ChangeRequestList[2].xlsx' because the file
> format or file extension is not valid. Verify that the file has not been
> corrupted and that the file extension matches the format of the file."
>
> The gridview does have paging on. I took it off to make one long gridview
> on one page and the error still occurs eitherway.
>
> Here is the code that I am using for the export. It is the same as what I
> have been finding when searching for exporting information.
>
> Does anyone know what the reason is behind the error and how to fix it?
>
> Thanks... John