Excel 2007 user warning when opening xls files

5,146

Solution 1

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.

Solution 2

In your VBA code, use this command:

Application.DisplayAlerts = False

this will suppress any such warnings.

Share:
5,146
Simon
Author by

Simon

Updated on September 17, 2022

Comments

  • Simon
    Simon over 1 year

    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?

  • SamB
    SamB over 10 years
    I think you meant to say .xlsx, not .xml?
  • Giacomo1968
    Giacomo1968 over 8 years
    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.