# Microsoft Office Application Help - Excel Help forum > Excel Programming / VBA / Macros >  >  ERROR: Microsoft Office Excel has encountered a problem and needs to close

## Kathy25

Hi,

we have recently upgraded from Office 2003 to Office 2007. Our users are using some Excel files  created in Excel 2003. These files contain some code in VBA. 
There is a CLOSE button on the form and when they hit on that close button excel is araising the following exception.

"Microsoft Office Excel has encountered a problem and needs to close. We are sorry for the inconvenience."

I guess this we don't have any problem with the code because these applications were running fine in Excel 2003, but they are giving the above error when we are trying to open them Excel 2007.

How can I solve this problem?

Thanks

----------


## leza23

This message can occur when you try to open or save a 2007 Office document or spreadsheet using an earlier version of the application. The reason for the error is that, by default, Office 2007 saves files in a format based on Office Open XML (Extensible Markup Language), which creates files that are smaller and easier to recover from file corruption.  So due to this if your excel files got corrupted then you need excel repair software as I did in the past. Try Stellar Phoenix Excel Repair Software from here: http://www.repair-excel-file.com/ and scan your file. If you are able to view your exact data and you are satisfied then get the full version from the site and save your data.

----------


## royUK

post the code, it might need tweaking

----------


## zlatan24

For work with excel files advise try this tool-recover xlsx files,as far as i know it is free,utility keep your work in Microsoft Excel workbook and you do not have other copies of this file, recover all these graphics, interviews, tables and reports in Microsoft Excel format,program is the best way to recover corrupt .xlsx file,can open any of your corrupted xlsx files, analyze it for errors and preview recovered contents,export contents into a new document and restore Excel file xlsx.

----------


## CarlWillems

I have also found that this error may occur when having circular references in code, like I encountered today when asked to look into a file that created this error:




```
Please Login or Register  to view this content.
```

----------

