When attempting to run VBA code in Excel, the following error may be thrown: "File not found". When you click OK, the Visual Basic Editor (VBE) shows up and you may have to break out of the code. Or, Excel may just crash with the following error signature:
Faulting application name: EXCEL.EXE, version: 14.0.6117.5003, time stamp: 0x4f622ef8Faulting module name: VBE7.DLL, version: 22.214.171.124, time stamp: 0x4e49ae34
The version of Excel may vary as may the version of VBE.DLL
To get past this error there are a couple of things you can do.
Method1 - Recompile the Project
1. Open the workbook in Excel. Normally Excel will disable macros in a worksheet until you click a button to enable the macros. Do not enable the macros just yet.2. Open the VBA editor. You can hit ALT+F11 or on the ribbon click Developer > Visual Basic3. In the VBA editor double click your module or first module that contains your project. Add a commented line of code such as:
‘ This is a comment
Then click on the Debug menu at the top and click Compile VBA Project.
Repeat this step for each module in your workbook and then save the workbook.
4. Close the workbook and re-open it and enable the macros and test it.
Method 2 - Disable Compile on Demand
In the VBE Editor in Excel, click on Tools > Options > General tab and click to uncheck “Compile on Demand”.
Alternatively you can set the following registry key:
HKEY_CURRENT_USER\Software\Microsoft\VBA\7.0\CommonType: DWORDName: CompileOnDemandValue: 0