How to Fix Runtime Error 1004 in Excel? 6 Easy Steps

Fix & Repair

Fix all your Excel and PC errors with FREE Advanced SystemCare app & enhance your online security.

Runtime Error 1004 is a common problem in Microsoft Excel that many people encounter. This error usually happens when you’re trying to use a Visual Basic for Applications (VBA) code, causing your macro or Excel program to unexpectedly crash. In this guide, we’ll look into why this error occurs and give you step-by-step instructions on how to fix it. By the end, you’ll know what causes Runtime Error 1004 in Excel and how to solve it.

This error specifically affects apps that use Microsoft Visual Basic for Applications (VBA), a programming language embedded in Microsoft Office to automate tasks. All Microsoft Office apps use this type of programming, but Excel, especially the 2007 version, tends to have more issues.

Most users experience problems when creating macros. Macros are a feature in Excel that records your keystrokes and clicks to help automate repetitive tasks. Sometimes, these tasks conflict with VBA, leading to the 1004 error. Another common reason for this error is a corrupted Excel application or XLS file. Other factors linked to this error include having too many legend entries that take up too much space, and a conflict between Excel and other apps.

Those issues can be interconnecting and cause more error than you might expect. Some of them the most common one is missing scroll bars in Excel and when you’re unable to paste data.

How to Fix Runtime Error 1004 in Excel

Below are the most commonly encountered Runtime 1004 errors; although the exact error message may vary, the error code remains the same:

  1. “Run-time error 1004: Application or Object-defined error”.
  2. “Excel VBA Runtime error 1004: Select method of Range class failed”.
  3. “Excel macro Run-time error 1004”.
  4. “Run-time error 1004: Method Range of Object Worksheet failed”.
  5. “Run-time error 1004: Copy Method of Worksheet Class failed”.
  6. “Run-time error 1004: Cannot run the Macro in Excel”.

Now, that we have a basic understanding of this error, let’s begin with the solutions:

6 Solutions to Fix Runtime Error 1004 in Excel

Fix 1: Uninstall Microsoft Works

Fix Excel now Advanced SystemCare will automatically fix your Excel Runtime errors and other PC issues that might lead to it.

In some cases, conflicts with “Microsoft Work” may trigger “Runtime Error 1004”. It’s an old app that might cause issues if you’re still using it.
To resolve this, consider uninstalling “Microsoft Work”, if installed. This can be done through the “Control Panel” on your computer. Here are detailed steps:

  • Press the ‘Win+S’ keys and type “Control Panel” and open the “Control Panel” on your computer 
  • Navigate to “Programs” and then “Programs and Features”.
  • Look for “Microsoft Works” in the list of installed programs.
  • Right-click on “Microsoft Works” and select “Uninstall”.
Uninstall Microsoft Works
  • Follow the prompts on-screen to complete the uninstallation process.

Fix 2: Delete “GWXL97.XLA” File

The presence of the “GWXL97.XLA” file may lead to runtime errors. Deleting this file can help in resolving the issue. Here’s how you can do it:

  • Open “File Explorer” and navigate to the Excel Folder, you can follow the directory: C:\Program Files\MSOffice\Office\XLSTART
  • Search for the “GWXL97.XLA” file.
  • Right-click on the file and select “Delete”.
  • Confirm the deletion when prompted.
Delete "GWXL97.XLA" File
  • Now, reopen “Excel” and try to run the worksheet.

*Please note that the path mentioned may vary depending on the installation location and version.

Fix 3: Create a New Excel Template

Runtime Error 1004 may also be caused by a corrupted Excel template. Create a new template by saving a blank workbook as the default template. This can often resolve issues related to corrupted templates. Follow the below steps:

  • Open a new, blank workbook in “Excel”. Ensure to keep only one worksheet in the workbook.
  • Customize the workbook to your preferences or leave it blank.
  • Now save the file using “Save as” and if you are using a 2003 or earlier version of Excel, save the workbook as the Excel Template (.xlt) and if you are using a 2007 or later version, use Excel Template (.xltx).
Save excel file as xltx
  • After saving the document successfully, you can use the following code to insert the template: Sheets.Add Type:=path\filename
  • Replace “filename” with the specific name of the document.

Fix 4: Check the Trust Access to the VBA

Ensure that your Excel settings allow trust access to the VBA project. This can help resolve the error. Here are the steps:

  • Open “Excel” and go to the “File” tab.
  • Click on “Options” at the bottom of the left-hand menu.
  • Select the “Trust Center” option in the left-hand menu within the Excel “Options” window.
  • Click on “Trust Center Settings”.
Click Trust Center Settings
  • Choose “Macro Settings” in the Trust Center dialog box.
  • Now, check the checkbox next to “Trust access to the VBA project object model”, select the “Enable all Macros” option and click “OK”.
Macro Settings for Excel
  • Reopen “Excel” once done and check if the error has been resolved.

Fix 5: Repair Corrupted Excel File

Corrupted Excel files can contribute to “Runtime Error 1004”. You can utilize Excel’s built-in repair tool for this purpose. We suggest backing up data before attempting to repair a corrupted file. Here’s how you can repair a file:

  • Open Excel and go to the “File” tab.
  • Choose “Open”, and then select the corrupted Excel file.
  • Click the arrow next to the “Open” button and choose “Open and Repair”.
Repair Corrupted Excel File
  • Follow the prompts to repair the file.

Fix 6: Repairing or Reinstalling Excel

If none of the previous solutions work, you can try repairing or reinstalling Microsoft Excel. 

  • Open the “Control Panel” on your computer.
  • Navigate to “Programs” and then “Programs and Features”.
  • Locate “Microsoft Office” in the list of installed programs.
  • Right-click on “Microsoft Office” and choose either “Change/Repair” or “Uninstall”.
Repairing or Reinstalling Excel
  • Follow the on-screen prompts to repair or reinstall “Microsoft Office”.

And that’s all, guys! We genuinely hope that by following these step-by-step solutions, you effectively solved Runtime Error 1004 in Excel. Be it adjusting settings, deleting problematic files, or repairing Excel itself, these steps are designed to ensure a smoother experience, allowing you to seamlessly continue your work with MS Excel.

Offer
Get an auto-fix solutionGet iobit Now

iobit Advanced System Care is used by millions of users worldwide.

It’s a “must-have” for every PC or MAC user who wants:

  • To fix common PC errors automatically
  • To speed up their computer performance
  • To fully secure their device
Other Guides That May Be Useful:

Have anything to say or share your issues regarding this guide?

0 0 votes
Rate This Guide
guest

0 Comments
Inline Feedbacks
View all comments
About the author
Joshua Hohendorf
Joshua Hohendorf - Author

Joshua is an author at WindowsFixHub.

His experience involves Product and Program Management with the knowledge and ability to get things done. Utilizing basic to advanced IT work such as setting up new networks, troubleshooting software, and computer maintenance.