Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
2.00/5 (2 votes)
See more:
When i am exporting to excel file and saving it with xlsx format, it saves the file. But when i am opening the file it gives me the error as follows.

"Excel cannot open the file 'filename.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."


but when i change the extension to .xls it opens the file. but the problem is if my rows are going beyond 65536 rows gets truncated after that. So that is the reason i amd saving it as .xlsx.


Is there any difference between exporting a file to excel 2003 and excel 2007 from vb.net 2008?
Posted
Comments
bbirajdar 5-Jul-12 10:38am    
There are thousands of ways of exporting the data to excel....How can we guess the problem unless we know what code/logic you have written?
ZurdoDev 5-Jul-12 11:08am    
Yes, there is a huge difference. The file format for xlsx is very different which is why you can't just name it that way and have it work. If you shared the code someone could possibly offer a better solution.

 
Share this answer
 
You may have a research on this artilce: Exporting Data to Excel[^]
 
Share this answer
 
Refer this MSDN link[^].
It has accepted answer.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900