logo
Office Fix Runtime Error 1004 in Microsoft Excel

How to Fix Runtime Error 1004 in Microsoft Excel

By Sophia | Last Updated

Excel runtime error 1004 is the error code that could occur if the Excel file is corrupted or when you run VBA or generate a Marco in the Excel worksheet, etc. Generally, Microsoft Excel informs you of the runtime error 1004 with an message written with the detailed issue and here are some examples.

  1. VB: run-time error ‘1004': Application-defined or object-defined error
  2. Excel macro "Run-time error ‘1004
  3. Runtime error 1004 method open of object workbooks failed
  4. Run-time error '1004' - Microsoft Excel cannot access the file

fix runtime error 1004 in excel

If you are bothered with this annoying error code, just take it easy, because this article will introduce 3 ways for you to fix runtime error 1004 in MS Excel.

1. Trust Access to the VBA Project Object Model

Step 1: Open MS Excel and create a new workbook.

create a new workbook

Step 2: Click File option in the upper-left corner of the file.

click file option

Step 3: Choose Options button at the bottom of the left pane.

choose options button

Step 4: Click Trust Center Settings option in Trust Center section.

click trust center settings

Step 5: Switch to Marco Settings tab and then check the option Trust access to the VBA project object model. At last, hit OK button to save your settings.

trust access to vba project

Now, just open your Excel file to check whether the error is resolved.

2. Scan Your System for Malware

Malware can be a cause of the Excel runtime error 1004, so you are suggested to thoroughly scan your system for malware or viruses. For the antivirus program, you can make use of the Windows built-in app named Windows Defender or find a wanted one online.

full scan system with windows defender

3. Repair the Corrupted Excel File

If the ways above fail to fix the runtime error 1004 of your Excel file, it might mean that your Excel file is corrupted. To repair a corrupted Excel file, iSunshare Excel Repair Genius is one of the best solutions. As a comprehensive Excel repair tool, iSunshare Excel Repair Genius can resolve different types of corruption errors that make an MS .xlsx file be unopenable or unreadable. For how to use this useful tool to repair the corrupted Excel file, you can follow the operations below.

Step 1: Download, install and run iSunshare Excel Repair Genius on Windows.

download isunshare excel repair genius

Step 2: Click Open option to input the corrupted .xlsx file for repair.

access open dialog

open runtime error 1004 excel file

Step 3: Hit Restore button to execute the file repair task.

repair runtime error 1004 excel file

Step 4: After the Excel file is repaired, you can see a tips box as follows. To move on, click OK option.

hit ok button to continue

Step 5: Save the repaired Excel file to a wished destination after hitting Save button.

save repaired excel file

At last, you can open the recovered worksheet for normal usage.

open recovered excel file

Related Links: