Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am getting the following error warning when opening an .xls file generated using 'CarlosAg.ExcelXmlWriter.dll' in Excel 2007:

The file you are trying to open,'', 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 the file. Do you want to open the file now?

Any ideas how I can resolve this?

share|improve this question
    
Related: superuser.com/questions/66195 – Mehper C. Palavuzlar Jun 16 '10 at 13:37

It seems that the .xls file (Microsoft Excel 97-2003 format) is actually an .xlsx file (Microsoft Excel 2007 format). Changing the file extension from .xls to .xlsx should clear the warning message.

share|improve this answer

In your VBA code, use this command:

Application.DisplayAlerts = False

this will suppress any such warnings.

share|improve this answer

It's xml spreadsheet 2003 format, the correct extension is xml which is why it does not need excel installed.

share|improve this answer
    
I think you meant to say .xlsx, not .xml? – SamB Jan 13 '14 at 5:51
    
This is not an answer. This is a comment. If you found something helpful to you, then you should just up vote that question or answer. If you want to leave a comment, you should leave a comment. You need at least 50 reputation points to comment, but they are not hard to earn if you positively contribute to the site. – JakeGould Dec 17 '15 at 18:15

I tried changing the file extension to several extensions -- but the error always came up. I tried changing the settings in the registry -- but the error still appeared (I do not have admin rights and group policy probably overrides). I added [Application.DisplayAlerts = False] to my macro and it works!

share|improve this answer

protected by JakeGould Dec 17 '15 at 18:15

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.