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.
Below are the most commonly encountered Runtime 1004 errors; although the exact error message may vary, the error code remains the same:
- âRun-time error 1004: Application or Object-defined errorâ.
- âExcel VBA Runtime error 1004: Select method of Range class failedâ.
- âExcel macro Run-time error 1004â.
- âRun-time error 1004: Method Range of Object Worksheet failedâ.
- âRun-time error 1004: Copy Method of Worksheet Class failedâ.
- â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
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â.
- 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.
- 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).
- 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â.
- 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â.
- 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â.
- 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â.
- 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.
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