After working multiple days on an Excel worksheet with lots a data, charts en Macro’s the worksheet somehow crashes today. Altough I haven’t found out what iniated the problem (maybe the installation of Adobe Reader X?) I have found a “solution” to the problem.
First of all the symptoms.
After opening an Excel 2010 worksheet, with the Macros enabled (“Enable Content”), the worksheet can’t be saved. Saving the worksheet, or clicking on the Macros button (on the Developer tab), results in a crashing worksheet.
In the event log the followin error is logged:
Faulting application name: EXCEL.EXE, version: 14.0.4756.1000, time stamp: 0x4b9c0870
Faulting module name: VBE7.DLL, version: 220.127.116.11, time stamp: 0x4b7b2131
Exception code: 0xc0000005
Fault offset: 0x0000000000220b24
Faulting process id: 0x186c
Faulting application start time: 0x01cbcce7fe8ef29f
Faulting application path: C:Program FilesMicrosoft OfficeOffice14EXCEL.EXE
Faulting module path: C:PROGRA~1COMMON~1MICROS~1VBAVBA7VBE7.DLL
Report Id: 46c04576-38db-11e0-9560-8697dfeafdc5
Since the error only occurs when Macros (or VBA) is enabled, and the error references VBE7.DLL, I suspected the error to be in the VBA area.
After some research I found out that a bad / corrupt reference is causing the problem.
Although clicking Macros causes Excel to crash, clicking Visual Basic doesn’t. So let’s click it.
Next, open the project references dialog (Tools > References).
In this dialog (References – VBAProject) deselect a few references and acknowledge. You won’t be able to deselect references that are used, Excel will prevent you from this.
I deselected the reference “Microsoft Office 14.0 Object Library” and “OLE Automation”.
Now you can save the worksheet (and use Macros), the problem is solved!
PS: After saving the worksheet you can select the same references you deselected before.