Share via

run time error 1004

Mike Carron 0 Reputation points
2025-11-28T14:02:00.7366667+00:00

i get run time error 1004 when opening a file in excel

Microsoft 365 and Office | Excel | For home | MacOS
0 comments No comments

2 answers

Sort by: Most helpful
  1. John Oliver 11,630 Reputation points Independent Advisor
    2025-11-28T14:43:18.43+00:00

    Hello Mike Carron, thanks for posting this in our community.

    The Run-time Error 1004 in Excel usually occurs when VBA (Visual Basic for Applications) encounters an issue while trying to access or manipulate a workbook, worksheet, or range.

    This error can happen due to several reasons. The file you are trying to open may have an incorrect or incomplete path, or the file might not exist in the specified location. It can also occur if the workbook or sheet is protected, which prevents certain operations. Another common cause is a corrupted Excel file that is damaged or partially unreadable.

    Please see this related thread 1004 error fix, which might help resolve your issue.

    Kind regards,

    John Oli

    Was this answer helpful?


  2. AI answer

    2025-11-28T14:02:08.57+00:00

    Run-time error 1004 in Excel typically occurs when there is an issue with the method or property being called on an object, often due to the context in which the call is made. One common scenario that leads to this error is when trying to execute Object Model calls from the WorkbookOpen event while the workbook is still in protected view.

    To resolve this issue, you can try the following:

    1. If the location from which you are opening the workbook is trusted, add that location to Excel's Trusted Locations.
    2. Defer the Object Model calls to the WorkbookActivate event instead of executing them directly in the WorkbookOpen event.

    This approach can help avoid the runtime error by ensuring that the workbook is fully activated before making any Object Model calls.

    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.