- Video Recovery
- SD Card Recovery
- Recycle Bin Recovery
- Recover Data from USB
- Recover Deleted Emails
- Hard Drive Not Showing Up in Windows
- Recover Unsaved Word Documents
- Recover Deleted Files in Windows 10/11
- Recover Files from Virus Infected Hard Drive
- Best Free Photo Recovery Software
- Recover Files from Formatted Hard Drive
Four ways to fix runtime error 1004 in Excel:
Workable Solutions | Step-by-step Troubleshooting |
---|---|
Fix 1. Delete the GWXL97.XLA Files | Fix the Excel error 1004 is to find and delete the error file. Go to C:\Program Files\MS Office\Office\XLSTART...Full steps |
Fix 2. Check the Trust Access to the VBA Project Object Model | Enable a VBA project trust option in Excel Trust Center to fix Excel error 1004. Open a blank Excel file...Full steps |
Fix 3. Create Another Excel Template | Start a new Excel workbook and make sure there is only one worksheet in it. Format the workbook first...Full steps |
Fix 4. Repair Corrupted Excel File | Repair corrupted Excel files with a file recovery tool. Stellar Toolkit for File Repair fixes severely corrupted XLS and XLSX files and retrieves everything from Excel...Full steps |
Microsoft Visual Basic for Applications (VBA) is developed to help users write programs for the Windows operating system. It runs as an internal programming language in Microsoft Office, such as Word, Excel, and PowerPoint.
Some users have reported that when running VBA in an Excel chart or trying to generate a Macro in Excel documents, an error message popped up saying: Runtime error 1004. And then they find themselves cannot access the Excel files. If you have the same encounter as these users, this post is the right place for you. You can find both the reasons and the corresponding solutions of this error code on this page.
Runtime Error Details
The error message contains more information than the error code 1004. Generally, follow the error code, you can see a brief description. The most repeated error messages are listed below:
- Runtime error 1004: Application or object-defined error.
- Runtime error 1004: Method Ranger of Object Worksheet failed.
- Runtime error 1004: Copy Method of Worksheet Class failed.
The Reason Why You See Runtime Error 1004 in Excel
If you want to know how to fix runtime error 1004 in Excel properly, you need to understand what leads to this issue. The following are the most prominent reasons.
- Macro Name Error
The Macro you are running is copying the original worksheet to a workbook with a defined name that you did not save and close before running the Macro.
- File Conflict
When opening the VBA Excel file, it gets conflicted with other programs.
- Too Many Legend Entries
The Excel chart contains more legend entries than space available to display the legend entries on the chart.
- Excel File Corruption
Your .xls files got corrupted, infected, or damaged.
Although many reasons would cause this Excel error 1004 problem, luckily, some valid methods can help users re-access the files. Let's check them one by one.
Fix 1. Delete the GWXL97.XLA Files to Fix Runtime Error 1004 in Excel
The easiest method to fix the Excel error 1004 is to find and delete the error file.
Step 1. Go to C:\Program Files\MS Office\Office\XLSTART.
Step 2. Find GWXL97.XLA file and delete it.
Step 3. Reopen your Excel file and check if the problem is solved.
Fix 2. Check the Trust Access to the VBA Project Object Model
Another solution you can try is to enable a VBA project trust option in Excel Trust Center. Follow the detailed steps and have a try.
Step 1. Open a blank Excel file and click "Files" on the upper left.
Step 2. Click Option and go to Trust Center.
Step 3. Find and enter the Trust Center Settings.
Step 4. Under Macro Settings, tick the option of "Trust access to the VBA project object model."
Now you can check your Excel file.
Fix 3. Create Another Excel Template to Fix Runtime Error 1004 in Excel
This method could be a little bit complicated, but it's useful and worth trying.
Step 1. Please start a new Excel workbook and make sure there is only one worksheet in it.
Step 2. Format the workbook first and then put the data you need onto it.
Step 3. Tap File > Save As, first enter the file name, and click the unfold arrow in Save as Type column.
Excel 2003: Choose Excel 97-2003 Template.
Excel 2007 or Later: Choose Excel Template.
Step 4. Click "Save" to confirm.
Now you can insert it programmatically by using the following code: Add Type:=path\filename. The file name is the one you set when you create the new Excel template.
Fix 4. Repair Corrupted Excel Files Due to Error 1004
If all the above solutions can't help you out, then there is one possibility that the Excel file you want to open is damaged. To fix a damaged Excel file, you can rely on file repair software. Stellar Toolkit for File Repair is a great choice.
With this tool, click the "Repair" button and wait for it to fix all the corrupted documents for you.
- Repair various corrupted files, including repairing Word, Excel, and PDF document
- Fix unreadable contents in Word efficiently
- Repair corrupted PDF files, extract the text, comments, labels, graphics, etc.
- Compatible with Microsoft Office 2019, 2016, 2013, 2010, & previous versions.
Download the software and follow the detailed steps below to fix corrupted Excel files.
Step 1. Select the Excel Files
Download, install and launch Stellar Toolkit for File Repair. Go to the software's home screen and click "Repair Spreadsheet".

Step 2. Repair the Excel Files
Browse to select the corrupt Excel files (XLS/XLSX). You can click on the Search option if you don't know its location. Once the file is selected, click "Repair". The software will initiate the scanning and repairing process.

Step 3. Preview and Save
Once the scan and repair process is over, the items will be displayed in a tree-view on the software's left-hand panel. Preview the items by double-clicking on them.
If the file preview is satisfactory, click the "Save File" button on the main menu. When prompted, choose the destination to save the salvaged file. Click "OK".

The Bottom Line
After reading, you must have a thorough understanding of how to fix Runtime error 1004. If you can make sure that the Excel file you want to open is valid, then the first three methods would help you out.
Once you got a damaged Excel file, a professional file recovery tool is a wiser choice. Stellar File Repair Software is highly recommended by many users & IT professionals to help you repair Word, Excel, PowerPoint, and PDF files.
Was This Page Helpful?

Cedric Grantham is one of the senior editors of EaseUS who lives and works in Chengdu, China. He mainly writes articles about data recovery tutorials on PC and Mac and how-to tips for partition management. He always keeps an eye on new releases and likes various electronic products.

Gemma is member of EaseUS team and has been committed to creating valuable content in fields about file recovery, partition management, and data backup etc for many years. She loves to help users solve various types of computer related issues.
-
EaseUS Data Recovery Wizard is a powerful system recovery software, designed to enable you to recover files you’ve deleted accidentally, potentially lost to malware or an entire hard drive partition.
Read More -
EaseUS Data Recovery Wizard is the best we have seen. It's far from perfect, partly because today's advanced disk technology makes data-recovery more difficult than it was with the simpler technology of the past.
Read More -
EaseUS Data Recovery Wizard Pro has a reputation as one of the best data recovery software programs on the market. It comes with a selection of advanced features, including partition recovery, formatted drive restoration, and corrupted file repair.
Read More
Related Articles
-
Full and Free Solutions for CHK File Recovery
Roxanne/2022/01/18
-
Remove Virus That Automatically Delete Files
Jean/2022/04/06
-
How to Open Password Protected Excel Files
Brithny/2022/04/06
-
CMD File Recovery - Recover Deleted Files Using Command Prompt
Tracy King/2022/01/19