Method 'OnKey' of object '_Application' error on opening Excel
    • Dark
      Light
    • PDF

    Method 'OnKey' of object '_Application' error on opening Excel

    • Dark
      Light
    • PDF

    Article summary

    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:

    1. Click the File menu in Excel, then click Options (near the bottom).

    2. On the left, click Trust Center, then the Trust Center Settings button on the right.

    3. 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.

    4. On the left, click Protected View, and make sure all three checkboxes on the right are unchecked.

    5. Close any open Excel documents, and try again.


    Was this article helpful?

    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.