Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB9.0
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 5-Jul-12 5:07am
Comments
aspnet_regiis at 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?
ryanb31 at 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.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Refer this MSDN link[^].
It has accepted answer.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

You may have a research on this artilce: Exporting Data to Excel[^]
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 499
1 Maciej Los 325
2 Sergey Alexandrovich Kryukov 234
3 DamithSL 233
4 Mathew Soji 195
0 OriginalGriff 7,168
1 Sergey Alexandrovich Kryukov 6,377
2 DamithSL 5,461
3 Manas Bhardwaj 4,876
4 Maciej Los 4,450


Advertise | Privacy | Mobile
Web02 | 2.8.1411023.1 | Last Updated 6 Jul 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100