In some cases after upgrading to Excel 2007, you may get the following error:
The file you are trying to open .xlsx is in a different format than specified by the file extension. verify the file is not corrupted and is from trusted source before opening the file. Do you want to open the file now?
This errors particularly occurs when you’re trying to open an XLS file (Excel 2000-2003) with Excel 2007. In most cases, the problem can be solved by defining MIME types and associating them with extensions.
When you’re using a Document Management System (like Sharepoint or Livelink), you can try adding these:
.xls = application/msexcel
.xlsx = application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
However, if you don’t want to look for a solution, but just want to solve the problem, insert this key in your registry to suppress the notification:
[HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Excel\Security]
“ExtensionHardening”=dword:00000000
You can accomplish the above by doing the following:
- Open your Registry (Start -> Run -> regedit.exe)
- Navigate to HKEY_CURRENT_USER\SOFTWARE\MICROSOFT\OFFICE\12.0\EXCEL\SECURITY
- Right click in the right window and choose New -> DWORD
- Type “ExtensionHardening” as the name (without the quotes)
- Verify that the data has the value “0″
This really works !
Thank you,
Ananth
(Quote)
Hey Thanks For it Awesome its working
(Quote)
it really worked for me.Thanks for the solution
(Quote)
thanks for you friend but I use and try it
(Quote)
Hi,
wow great solution its working fine
thank you for your solution
Sridhar Gumpula
(Quote)
THANKS!!, IT REALLY WORKS.
BEST REGARDS.
(Quote)
sir
i have tried your trick, file become open with out any error but the content of file become changed in 0 1 and others alphabatic, please hel me out
(Quote)
I will try in all the possible cases and let you know.
(Quote)
hi
ive tries your trick , now i m not getting the error msg , but file is still corrupt all i c is special character but no data.
can u help me with that
thank u
(Quote)
We tried by setting in registry. Its working fine.
Eventhough is there any other way?.
Pls advice.
(Quote)
even i am same face if u found any solution let me
Thank you,
Narender
(Quote)
Do you have a solution for Vista? The registry values as explained must be in XP only, because the information is not found in the visa registry. Can you confirm. Thank you.
(Quote)
I had changed the registry values as suggested. I could able to open the files
without any error this is great and I am getting a blank worksheet and I am worried about my data. Any work around this to retreive my data back.
Thanks,
Surender.
(Quote)
Even changed the setting the ContentType for XLS as well as XLSX
I am getting the same problem with the error mesg “Different format than specified by the file extension”
Jon Where I have to add code “FilFormatNum” , cna you please give examples
(Quote)
This error is commonly caused when .SaveAs VBA code (or export from an application) specifies the file should be created as filename.xls whilst saving in 2007 (i.e. xml) format.
When this file is then opened:
- In Office 2007 you get the format file extension error but it will open and work fine
- In Office 97-2003 the file will open but will appear corrupted as 97-2003 cannot interpret xml files
The solution from a macro perspective is to modify the code to specify the file format by adding the following code if you need to share with people on older excel (this will make it save in .xls format as well as be named . xls):
FileFormatNum = 56
or
FileFormatNum = xlExcel8
If only sharing with 2007 users, modifying the filename to be filename.xlsx will also solve this issue (this can also be done manually if files are only used by 2007 users).
Hope this helps
(Quote)
nothing worked.. all tried .. changed .xls to .xlsx and changed in registry as well.
Any other solution..
(Quote)
No complicated reg settings or modifications, just rename the .xls extension to .xlsx, you are done.
(Quote)
I tried above solution and it works fine for me. But i don’t want to do any changes in registry .Is there any other solution ?
I am using c# and asp.net 2.0 . Here i am export grid view in excel file and when i opened excel file that time above warning message i am facing .
Regard,
Umesh.
(Quote)
Thanks God….Its working..Thanks to UUUUUUUU too
(Quote)
Inspite of setting the ContentType for XLS as well as XLSX…I am getting the same problem with the weird mesg “Different format than specified by the file extension”
Any help is highly appreciated
-Sreek
(Quote)
I don’t have security folder. I added the same under ..\EXCEL\ folder and it didn’t work
(Quote)
Hi I tried adding HKEY_CURRENT_USER\SOFTWARE\MICROSOFT\OFFICE\12.0\EXCEL\SECURITY
but my excel documents are still corupt. any help please
(Quote)
Thank pal..It really hepled me
(Quote)
Thank you so very much. I’ve been pestered by that annoying pop-up for months; I deal with a very large number of Excel files that don’t have an extension and constantly throw this error. This has seriously given me 5 minutes of my day back.
(Quote)
I heard about not bad application-xlsx repair Microsoft, know how will display a dialog box with the question whether this worksheet should actually be scanned, also with help it you may try to open the necessary *.xls, *,xlt, *.xlsx, xlsm, *.xltm, *.xltx, *.xlam file and see an error message on the screen instead of it: Microsoft Excel unable to read file, This file is not in a recognizable format, etc.
(Quote)
hi
ive tries your trick , now i m not getting the error msg , but file is still corrupt all i c is special character but no data.
can u help me with that
thank u
(Quote)
Thanks for solution
(Quote)
Thank you! As a non techie…your instructions were great! It took care of the problem.
(Quote)
Its working!!!!! wonderful….
(Quote)
Thanks a lot.
(Quote)
Hi ,
I have already tried the above solution , it’s working. But i want the solution in the way that from the jsp code. If you find any solution
i will be very happy.
Thanks,
vasanth.
(Quote)
Hi,
Your solution really worked.Its excellent.
Thanks,
Amber Bhatnagar.
(Quote)