Fix Runtime Error

In Excel, a Run-time error '1004' typically occurs when running a macro or modifying range values, or when there's an issue with the VBA code. This error can also happen when there are too many legend entries in a Microsoft Excel chart that exceed the available space.

Four Methods to Fix "Runtime Error 1004" in Excel:

"Translating English to Chinese refers to the process of converting English text into Chinese. If you have an English text that needs translation, please let me know, and I'll do my best to assist you."

Solutions That Work Step-by-Step Troubleshooting
Solution 1: Repair Corrupted Excel File Use a file recovery tool to repair the corrupted Excel file. File recovery tools can fix severely damaged XLS and XLSX files and recover all content from Excel...Full Steps
Solution 2: Remove GWXL97.XLA Add-in Fix the Excel error 1004 by locating and deleting the problematic file. Go to C:\Program Files\MS Office\Office\XLSTART...Full Steps
Solution 3: Check VBA Trust Access Permissions Enable the VBA project trust option in the Excel Trust Center to fix the Excel error 1004. Open a blank Excel file...Full Steps
Solution 4: Create a New Excel Template Create a new Excel workbook with only one worksheet. First, format the workbook...Full Steps

Microsoft Visual Basic for Applications (VBA) is a programming language designed to help users create programs for the Windows operating system. It runs as an internal programming language within Microsoft Office applications like Word, Excel, and PowerPoint.

Some users have reported encountering the error message “Run-time error '1004'” when running VBA in an Excel chart or attempting to generate a macro within an Excel document. Subsequently, they find themselves unable to access their Excel files. If you've experienced something similar, then you've come to the right place. On this page, you'll find the reasons behind this error code and the corresponding solutions.

How to Fix Excel Error 1004

Runtime Error 1004: Detailed Information

The error message will provide more information than Error code 1004. A short description usually appears after the error code. Here's a list of recurring error messages:

    • Runtime error 1004: Application-defined or object-defined error.
    • Runtime error 1004: The Range method of the Worksheet object failed.
    • Runtime error 1004: The Copy method of the Worksheet class failed.

Solution 1: Repair an Excel file corrupted due to Runtime Error 1004

If none of the above solutions work for you, there's a possibility that the Excel file you're trying to open is corrupted. To repair a damaged Excel file, you can use a file repair tool. Fixo Document Repair is a good option to consider.

Use this tool, click on the “Repair” button and wait for it to fix all your corrupted documents.

    - Repair various corrupted files, including fixing Word, Excel, and PDF documents - Effectively repair unreadable content in Word - Restore damaged PDF files, extracting text, annotations, bookmarks, graphics, etc. - Compatible with Microsoft Office 2019, 2016, 2013, 2010, and earlier versions.

Watch this video first before proceeding with the fixes for the runtime error 1004 in Excel. It will give you more details on file repair.

  • 00:14 - Method 1: Insert into a New Word Document
  • 00:38 - Method 2: Open and Repair
  • 00:55 - Method 3: Default Settings
  • 01:30 - Method 4: Using the Fixo Document Repair Tool

Download the software and follow the steps given below to repair corrupt Excel file:

Step 1: Download and run Fixo on your computer or laptop. Select "File Repair" to fix corrupted Office documents, including Word, Excel, PDF, and so on. Click "Add File" to select the damaged document.

Repairing documents with Fixo

Step 2. Click “Repair All” to fix multiple files. If you only want to repair one, hover over the target file and click “Repair.” You can also preview the file by clicking on the eye icon.

Select the file to repair Select the file to repair

Click “Save” to save the selected documents. Choose “Save All” to save all repaired files. Select “View Repaired Files” to locate the folder with the repaired files.

Save the repaired document in Fixo

Solution 2: Remove GWXL97.XLA to Fix Excel Runtime Error 1004

The easiest way to fix Excel Error 1004 is to locate and delete the problematic file.

Step 1: Go to the C:\Program Files\MS Office\Office\XLSTART folder.

Step 2: Locate and delete the GWXL97.XLA file.

Step 3. Reopen your Excel file and see if the issue has been resolved.

Share this post on social media to help others learn how to fix Runtime Error 1004 in Excel.

The Chinese character " " translates to "Non-breaking space" or "No-break space" in English. It is commonly used in web pages and documents to occupy space or create gaps between elements.

Fix 3: Check Trust Access to the VBA Project Object Model

Another solution you could try is to enable the Trust VBA Project Option in the Excel Trust Center. Please follow the detailed steps and give it a shot.

Step 1: Open a new Excel file and click on "File" in the top-left corner.

Step 2: Click Options, and then go to the Trust Center.

Enter Excel Option

Step 3. Locate and open Trust Center settings.

Go to Trust Center settings

Step 4. Under Macro Settings, check Trust access to the VBA project object model.

Trust access to the VBA project

Now you can check your Excel file.

Solution 4: Create Another Excel Template to Fix Runtime Error 1004 If none of the above solutions work, you can try creating a new Excel template. Sometimes, the issue might be with the current workbook's settings or configuration. By creating a new template, you ensure that no old settings are carried over that could cause the error. Follow these steps: 1. Open Excel and select "File" > "New" > "Blank Workbook." 2. In the new blank workbook, set up the formatting, formulas, and features you need. 3. Save this workbook as a template. Go to "File" > "Save As," then choose "Excel Template (*.xltx)" from the "Save as type" dropdown menu. 4. Name your template and click "Save." 5. Close the current workbook and create a new one using the new template. 6. Check if the runtime error 1004 still occurs. If the error no longer appears, the problem might be related to the original template. Please note that creating a new template might result in the loss of specific settings and data from the previous workbook. Before proceeding, make sure to back up any important information.

This approach is a bit complicated, but it works and is worth trying.

Step 1: Start a new Excel workbook and make sure it contains only one worksheet.

Step 2: Format your workbook and input your data.

Step 3: Click File > Save As, type a name for the file, and then click the down arrow in the Save As Type list.

Excel Save As

Excel 2003: Click Excel 97-2003 Template.

Excel 2007 or later: Select the Excel template.

Select an appropriate template

Click “Save” to confirm.

You can now insert the file programmatically with the code Add Type:=path\filename, where filename is the name you gave the new Excel template when you created it.

The reason for encountering Runtime Error 1004 in Excel

If you're wondering how to fix the Runtime Error 1004 in Excel, you need to understand the reasons behind this issue. Here are some of the most common causes.

    • Macro name error: The macro you're running is copying an original worksheet into a workbook that has defined names that were not saved and closed before running the macro.
    • File conflict: A conflict with another program when opening a VBA Excel file.
    • Too many legend entries: The number of legend entries in an Excel chart exceeds the available space to display them on the chart.
    • Corrupted Excel file: Your .xls file is corrupted, infected, or damaged.

Although there can be many reasons for this Excel Error 1004 to occur, luckily, there are effective methods that can help users regain access to their files. Let's check them out one by one.

Bottom line

After reading this, you should have a deep understanding of how to fix runtime error 1004. If you can ensure that the Excel file you are trying to open is valid, the first three methods will be of help to you.

If your Excel file is damaged, it's wiser to use a professional file recovery tool. Many users and IT professionals recommend using the Fixo tools to help you repair Word, Excel, PowerPoint, and PDF files.