- Print
- DarkLight
- PDF
Method 'OnKey' of object '_Application' error on opening Excel
- Print
- DarkLight
- PDF
Problem
Upon opening a Report Writer Excel document, the user receives the error message:
Run-time error ‘1004’:
Method ‘OnKey’ of object’_Application' failed
Typical Cause
This error appears to arise if a user is opening a Report Writer Excel file with access to macros blocked, such as by Protected View.
Solution
To fix the Method 'OnKey' of object '_Application' error, follow the steps below:
Click the File menu in Excel, then click Options (near the bottom).
On the left, click Trust Center, then the Trust Center Settings button on the right.
On the left, click Macro Settings, and set it to the fourth option (Enable all) on the right. Also check Trust access to the VBA project object model.
On the left, click Protected View, and make sure all three checkboxes on the right are unchecked.
Close any open Excel documents, and try again.