Application defined or object defined error vba как исправить

Как исправить ошибку Microsoft Excel 1004 Номер ошибки: Ошибка 1004 Название ошибки: Application-defined or object-defined error Описание ошибки: Run-time error ‘1004’. Application-defined or object-defined error. Разработчик: Microsoft Corporation Программное обеспечение: Microsoft Excel Относится к: Windows XP, Vista, 7, 8, 10, 11 Проверка «Application-defined or object-defined error» Обычно люди ссылаются на «Application-defined or object-defined error» […]

Содержание

  1. Как исправить ошибку Microsoft Excel 1004
  2. Проверка «Application-defined or object-defined error»
  3. Что генерирует ошибку времени выполнения 1004?
  4. Распространенные проблемы Application-defined or object-defined error
  5. Причины проблем Application-defined or object-defined error
  6. Определенная приложением или объектом ошибка
  7. Перечисление перехватываемых ошибок для ведущего приложения
  8. Поддержка и обратная связь
  9. VBA Error 1004 – Application-Defined or Object-Defined Error
  10. VBA Error 1004 – Object does not exist
  11. VBA Error 1004 – Name Already Taken
  12. VBA Error 1004 – Incorrectly Referencing an Object
  13. VBA Error 1004 – Object Not Found
  14. VBA Coding Made Easy
  15. VBA Code Examples Add-in
  16. VBA 1004 Error
  17. VBA Error 1004 in Excel
  18. Top 6 Excel VBA 1004 Runtime Errors
  19. #1 – VBA Run Time Error 1004: That Name is already taken. Try a different One:
  20. #2 – VBA Run Time Error 1004: Method “Range” of object’ _ Global’ failed:
  21. # 3 – VBA Run Time Error 1004: Select Method of Range class failed:
  22. #4 – VBA Runtime Error 1004 method open of object workbooks failed:
  23. #5 – VBA Runtime Error 1004 method Sorry We couldn’t Find:
  24. #6 – VBA Runtime Error 1004 Activate method range class failed:
  25. Recommended Articles

Как исправить ошибку Microsoft Excel 1004

Номер ошибки: Ошибка 1004
Название ошибки: Application-defined or object-defined error
Описание ошибки: Run-time error ‘1004’. Application-defined or object-defined error.
Разработчик: Microsoft Corporation
Программное обеспечение: Microsoft Excel
Относится к: Windows XP, Vista, 7, 8, 10, 11

Проверка «Application-defined or object-defined error»

Обычно люди ссылаются на «Application-defined or object-defined error» как на ошибку времени выполнения (ошибку). Чтобы убедиться, что функциональность и операции работают в пригодном для использования состоянии, разработчики программного обеспечения, такие как Microsoft Corporation, выполняют отладку перед выпусками программного обеспечения. Ошибки, такие как ошибка 1004, иногда удаляются из отчетов, оставляя проблему остается нерешенной в программном обеспечении.

Пользователи Microsoft Excel могут столкнуться с ошибкой 1004, вызванной нормальным использованием приложения, которое также может читать как «Run-time error ‘1004’. Application-defined or object-defined error.». Сообщение об этой ошибке 1004 позволит разработчикам обновить свое приложение и исправить любые ошибки, которые могут вызвать его. Затем Microsoft Corporation исправит ошибки и подготовит файл обновления для загрузки. Следовательно, разработчик будет использовать пакет обновления Microsoft Excel для устранения ошибки 1004 и любых других сообщений об ошибках.

Что генерирует ошибку времени выполнения 1004?

В первый раз, когда вы можете столкнуться с ошибкой среды выполнения Microsoft Excel обычно с «Application-defined or object-defined error» при запуске программы. Вот три наиболее заметные причины ошибки ошибки 1004 во время выполнения происходят:

Ошибка 1004 Crash — это распространенная ошибка 1004 во время выполнения ошибки, которая приводит к полному завершению работы программы. Эти ошибки обычно возникают, когда входы Microsoft Excel не могут быть правильно обработаны, или они смущены тем, что должно быть выведено.

Утечка памяти «Application-defined or object-defined error» — Когда Microsoft Excel обнаруживает утечку памяти, операционная система постепенно работает медленно, поскольку она истощает системные ресурсы. Возможные искры включают сбой освобождения, который произошел в программе, отличной от C ++, когда поврежденный код сборки неправильно выполняет бесконечный цикл.

Ошибка 1004 Logic Error — логическая ошибка Microsoft Excel возникает, когда она производит неправильный вывод, несмотря на то, что пользователь предоставляет правильный ввод. Когда точность исходного кода Microsoft Corporation низкая, он обычно становится источником ошибок.

Как правило, такие Microsoft Corporation ошибки возникают из-за повреждённых или отсутствующих файлов Application-defined or object-defined error, а иногда — в результате заражения вредоносным ПО в настоящем или прошлом, что оказало влияние на Microsoft Excel. Основной способ решить эти проблемы вручную — заменить файл Microsoft Corporation новой копией. Запуск сканирования реестра после замены файла, из-за которого возникает проблема, позволит очистить все недействительные файлы Application-defined or object-defined error, расширения файлов или другие ссылки на файлы, которые могли быть повреждены в результате заражения вредоносным ПО.

Распространенные проблемы Application-defined or object-defined error

Наиболее распространенные ошибки Application-defined or object-defined error, которые могут возникнуть на компьютере под управлением Windows, перечислены ниже:

  • «Ошибка Application-defined or object-defined error. «
  • «Недопустимая программа Win32: Application-defined or object-defined error»
  • «Извините за неудобства — Application-defined or object-defined error имеет проблему. «
  • «К сожалению, мы не можем найти Application-defined or object-defined error. «
  • «Application-defined or object-defined error не может быть найден. «
  • «Ошибка запуска программы: Application-defined or object-defined error.»
  • «Application-defined or object-defined error не выполняется. «
  • «Application-defined or object-defined error остановлен. «
  • «Неверный путь к программе: Application-defined or object-defined error. «

Эти сообщения об ошибках Microsoft Corporation могут появляться во время установки программы, в то время как программа, связанная с Application-defined or object-defined error (например, Microsoft Excel) работает, во время запуска или завершения работы Windows, или даже во время установки операционной системы Windows. Документирование проблем Application-defined or object-defined error в Microsoft Excel является ключевым для определения причины проблем с электронной Windows и сообщения о них в Microsoft Corporation.

Причины проблем Application-defined or object-defined error

Проблемы Application-defined or object-defined error вызваны поврежденным или отсутствующим Application-defined or object-defined error, недопустимыми ключами реестра, связанными с Microsoft Excel, или вредоносным ПО.

В частности, проблемы Application-defined or object-defined error возникают через:

  • Недопустимая или поврежденная запись Application-defined or object-defined error.
  • Вредоносные программы заразили Application-defined or object-defined error, создавая повреждение.
  • Application-defined or object-defined error злонамеренно или ошибочно удален другим программным обеспечением (кроме Microsoft Excel).
  • Другая программа находится в конфликте с Microsoft Excel и его общими файлами ссылок.
  • Поврежденная загрузка или неполная установка программного обеспечения Microsoft Excel.

Совместима с Windows 2000, XP, Vista, 7, 8, 10 и 11

Источник

Определенная приложением или объектом ошибка

Это сообщение появляется, когда ошибка, созданная с помощью метода Raise или инструкции Error, не соответствует ошибке, определенной Visual Basic для приложений. Оно вызывается также функцией Error для аргументов, не соответствующих ошибкам, определенным Visual Basic для приложений. Таким образом, это может быть ошибка, определенная вами или объектом, включая ведущие приложения, такие как Microsoft Excel, Visual Basic и т. д. Например, формы Visual Basic создают связанные с формами ошибки, которые нельзя создать из программы, просто указав номер в качестве аргумента метода Raise или функции Error. Это сообщение имеет следующие причины и решения:

Приложение выполнило оператор Err.Raisen или Errorn, но номер n не определен программой Visual Basic для приложений. Если это то, что требовалось, используйте Err.Raise и задайте дополнительные аргументы, чтобы конечному пользователю была понятна суть ошибки. Например, можно добавить строку описания, источник и справочную информацию. Чтобы повторно создать ошибку, которую вы перехватили, не следует выполнять перед этим Err.Clear. Если вначале выполнялась Err.Clear, нужно добавить дополнительные аргументы для метода Raise. Убедитесь, что воссоздаете ту же ошибку, просмотрев ее контекст;

при доступе к объектам из других приложений на вашу программу могла распространиться ошибка, которую нельзя сопоставить с ошибкой Visual Basic.

Просмотрите в документации описание объектов, к которым был доступ. У объекта Err свойство Source должно содержать программный идентификатор приложения или объекта, в котором создана ошибка. Чтобы понять контекст ошибки, возвращаемой объектом, вы можете использовать конструкцию On Error Resume Next, а не синтаксис строкиOn Error GoTo в коде для получения доступа к объектам.

Перечисление перехватываемых ошибок для ведущего приложения

Ранее программисты, как правило, использовали цикл для вывода всех строк с сообщениями об ошибках, которые можно перехватить. Обычно это описывалось в таком коде:

Такой код по-прежнему перечисляет все сообщения об ошибках Visual Basic для приложений, но отображает сообщение «Application-defined or object-defined error» («Ошибка, определенная приложением или объектом») для ошибок, определенных ведущими приложениями (например для тех, которые в Visual Basic относятся к формам и элементам управления). Многие из этих ошибок являются перехватываемыми ошибками выполнения. Используйте диалоговое окно Поиск в разделе справки, чтобы найти список перехватываемых ошибок вашего ведущего приложения. Щелкните Search (Поиск), введите trappable (перехватываемые) в первом поле ввода и нажмите Show Topics (Показать темы). Выберите Trappable Errors (Перехватываемые ошибки) в нижнем окне списка и нажмите Go To (Перейти).

Для получения дополнительной информации выберите необходимый элемент и нажмите клавишу F1 (для Windows) или HELP (для Macintosh).

Поддержка и обратная связь

Есть вопросы или отзывы, касающиеся Office VBA или этой статьи? Руководство по другим способам получения поддержки и отправки отзывов см. в статье Поддержка Office VBA и обратная связь.

Источник

VBA Error 1004 – Application-Defined or Object-Defined Error

In this Article

This tutorial will explain the VBA Error 1004- Application-Defined or Object-Defined Error.

VBA run-time error 1004 is known as an Application-Defined or Object-Defined error which occurs while the code is running. Making coding errors (See our Error Handling Guide) is an unavoidable aspect learning VBA but knowing why an error occurs helps you to avoid making errors in future coding.

VBA Error 1004 – Object does not exist

If we are referring to an object in our code such as a Range Name that has not been defined, then this error can occur as the VBA code will be unable to find the name.

The example above will copy the values from the named range “CopyFrom” to the named range “CopyTo” – on condition of course that these are existing named ranges! If they do not exist, then the Error 1004 will display.

The simplest way to avoid this error in the example above is to create the range names in the Excel workbook, or refer to the range in the traditional row and column format eg: Range(“A1:A10”).

VBA Error 1004 – Name Already Taken

The error can also occur if you are trying to rename an object to an object that already exists – for example if we are trying to rename Sheet1 but the name you are giving the sheet is already the name of another sheet.

If we already have a Sheet2, then the error will occur.

VBA Error 1004 – Incorrectly Referencing an Object

The error can also occur when you have incorrectly referenced an object in your code. For example:

This will once again give us the Error 10004

Correct the code, and the error will no longer be shown.

VBA Error 1004 – Object Not Found

This error can also occur when we are trying to open a workbook and the workbook is not found – the workbook in this instance being the object that is not found.

Although the message will be different in the error box, the error is still 1004.

VBA Coding Made Easy

Stop searching for VBA code online. Learn more about AutoMacro — A VBA Code Builder that allows beginners to code procedures from scratch with minimal coding knowledge and with many time-saving features for all users!

VBA Code Examples Add-in

Easily access all of the code examples found on our site.

Simply navigate to the menu, click, and the code will be inserted directly into your module. .xlam add-in.

Источник

VBA 1004 Error

VBA 1004 Error is a runtime error in VBA. It is also known as application-defined or object-defined error. Why is that? Because we have a limited number of columns in Excel. When our code gives the command to go out of range, we get a 1004 Error. There are other situations when we get this error when we refer to a range that does not exist in the sheet.

VBA Error 1004 in Excel

VBA 1004 Error is a run time error in VBA and occurs while running the code. Errors are part and parcel of the coding, especially when writing for the first time. Therefore, you may come across many errors in VBA. However, this is common for everybody, and there is no big deal about it.

However, knowing the error of why it is coming makes you avoid those mistakes in the coming future.

In this article, we will discuss one of the important errors in Excel, “VBA 1004 Error”.

Table of contents

You are free to use this image on your website, templates, etc., Please provide us with an attribution link How to Provide Attribution? Article Link to be Hyperlinked
For eg:
Source: VBA 1004 Error (wallstreetmojo.com)

Top 6 Excel VBA 1004 Runtime Errors

#1 – VBA Run Time Error 1004: That Name is already taken. Try a different One:

This error occurs while renaming the sheet.

If the worksheet’s name already exists. If you try to assign the same name to another sheet, VBA throws a “Run-time error ‘1004.’ ”

Look at the below code.

Code:

We are trying to rename sheet 2 as sheet 1. But, we already have a sheet named “Sheet1”.

If we run this code using the F5 key or manually, we will get “Run-time error ‘1004’ “: “That name is already taken. Try a different one.”

So, try renaming the sheet accordingly.

#2 – VBA Run Time Error 1004: Method “Range” of object’ _ Global’ failed:

For this, we have named the range of cells “Headings,” as shown in the below image.

Now, by using the RANGE object, we can access this range.

Code:

If you run this code by pressing the F5 key, then this code will select the named range.

But, if we mention the named range wrongly, we will get “Run-time error ‘1004.’ “Method “Range” of object’ _ Global” failed.

Code:

Run this code manually or use the F5 key and see the result.

# 3 – VBA Run Time Error 1004: Select Method of Range class failed:

It usually occurs when we try to select the cells other than the active sheet without making the sheet select or active.

Look at the below code.

Code:

The above code says to select the cells A1 to A5 in the worksheet “Sheet1”. However, to experiment, my present active sheet is “Sheet2”, not “Sheet1”.

We will run this code using the F5 key or manually to see what happens.

We got “Run-time error ‘1004.’ “Select method of Range class failed” as without activating the sheet; we try to select the cells of that sheet. So first, we need to activate the sheet before we select the cells. Below is the correct code.

#4 – VBA Runtime Error 1004 method open of object workbooks failed:

It usually occurs when you try to open the workbook, which has the same name as the other workbook we have already opened.

Look at the below code.

Code:

It will throw the below error.

#5 – VBA Runtime Error 1004 method Sorry We couldn’t Find:

This error occurs when you try to open the file which does not exist in the mentioned path. For example, it could move, be renamed, or deleted from the mentioned path. One reason for this is the wrong type of path or file name with the excel extension Excel Extension Excel extensions represent the file format. It helps the user to save different types of excel files in various formats. For instance, .xlsx is used for simple data, and XLSM is used to store the VBA code. read more .

Now, take a look at the below code.

Code:

This code says to open the file “ABC.xlsx” in the mentioned folder path.

We know there is no file in the mentioned folder path. So, we will get the: Run-time error ‘1004’ method when no file exists in the mentioned folder. Sorry, and We couldn’t find it.

#6 – VBA Runtime Error 1004 Activate method range class failed:

This error occurs mainly due to activating the range of cells without activating the worksheet.

Look at the below code.

Code:

This error is similar to the one we have seen in Run-time error’ 1004′: Select method of Range class failed.

If we run manually or use the F5 key, we will get the below error.

Because without activating the sheet, we cannot activate the cells in it. So first, activate the sheet and then activate the cells of that sheet.

Recommended Articles

This article has been a guide to VBA 1004 Error. Here, we discuss the top 6 types of 1004 run-time errors in VBA and how to fix them, along with examples and downloadable templates. Below are some useful articles related to VBA: –

Источник

Icon Ex Номер ошибки: Ошибка 1004
Название ошибки: Application-defined or object-defined error
Описание ошибки: Run-time error ‘1004’. Application-defined or object-defined error.
Разработчик: Microsoft Corporation
Программное обеспечение: Microsoft Excel
Относится к: Windows XP, Vista, 7, 8, 10, 11

Проверка «Application-defined or object-defined error»

Обычно люди ссылаются на «Application-defined or object-defined error» как на ошибку времени выполнения (ошибку). Чтобы убедиться, что функциональность и операции работают в пригодном для использования состоянии, разработчики программного обеспечения, такие как Microsoft Corporation, выполняют отладку перед выпусками программного обеспечения. Ошибки, такие как ошибка 1004, иногда удаляются из отчетов, оставляя проблему остается нерешенной в программном обеспечении.

Пользователи Microsoft Excel могут столкнуться с ошибкой 1004, вызванной нормальным использованием приложения, которое также может читать как «Run-time error ‘1004’. Application-defined or object-defined error.». Сообщение об этой ошибке 1004 позволит разработчикам обновить свое приложение и исправить любые ошибки, которые могут вызвать его. Затем Microsoft Corporation исправит ошибки и подготовит файл обновления для загрузки. Следовательно, разработчик будет использовать пакет обновления Microsoft Excel для устранения ошибки 1004 и любых других сообщений об ошибках.

Что генерирует ошибку времени выполнения 1004?

В первый раз, когда вы можете столкнуться с ошибкой среды выполнения Microsoft Excel обычно с «Application-defined or object-defined error» при запуске программы. Вот три наиболее заметные причины ошибки ошибки 1004 во время выполнения происходят:

Ошибка 1004 Crash — это распространенная ошибка 1004 во время выполнения ошибки, которая приводит к полному завершению работы программы. Эти ошибки обычно возникают, когда входы Microsoft Excel не могут быть правильно обработаны, или они смущены тем, что должно быть выведено.

Утечка памяти «Application-defined or object-defined error» — Когда Microsoft Excel обнаруживает утечку памяти, операционная система постепенно работает медленно, поскольку она истощает системные ресурсы. Возможные искры включают сбой освобождения, который произошел в программе, отличной от C ++, когда поврежденный код сборки неправильно выполняет бесконечный цикл.

Ошибка 1004 Logic Error — логическая ошибка Microsoft Excel возникает, когда она производит неправильный вывод, несмотря на то, что пользователь предоставляет правильный ввод. Когда точность исходного кода Microsoft Corporation низкая, он обычно становится источником ошибок.

Как правило, такие Microsoft Corporation ошибки возникают из-за повреждённых или отсутствующих файлов Application-defined or object-defined error, а иногда — в результате заражения вредоносным ПО в настоящем или прошлом, что оказало влияние на Microsoft Excel. Основной способ решить эти проблемы вручную — заменить файл Microsoft Corporation новой копией. Запуск сканирования реестра после замены файла, из-за которого возникает проблема, позволит очистить все недействительные файлы Application-defined or object-defined error, расширения файлов или другие ссылки на файлы, которые могли быть повреждены в результате заражения вредоносным ПО.

Распространенные проблемы Application-defined or object-defined error

Наиболее распространенные ошибки Application-defined or object-defined error, которые могут возникнуть на компьютере под управлением Windows, перечислены ниже:

  • «Ошибка Application-defined or object-defined error. «
  • «Недопустимая программа Win32: Application-defined or object-defined error»
  • «Извините за неудобства — Application-defined or object-defined error имеет проблему. «
  • «К сожалению, мы не можем найти Application-defined or object-defined error. «
  • «Application-defined or object-defined error не может быть найден. «
  • «Ошибка запуска программы: Application-defined or object-defined error.»
  • «Application-defined or object-defined error не выполняется. «
  • «Application-defined or object-defined error остановлен. «
  • «Неверный путь к программе: Application-defined or object-defined error. «

Эти сообщения об ошибках Microsoft Corporation могут появляться во время установки программы, в то время как программа, связанная с Application-defined or object-defined error (например, Microsoft Excel) работает, во время запуска или завершения работы Windows, или даже во время установки операционной системы Windows. Документирование проблем Application-defined or object-defined error в Microsoft Excel является ключевым для определения причины проблем с электронной Windows и сообщения о них в Microsoft Corporation.

Причины проблем Application-defined or object-defined error

Проблемы Application-defined or object-defined error вызваны поврежденным или отсутствующим Application-defined or object-defined error, недопустимыми ключами реестра, связанными с Microsoft Excel, или вредоносным ПО.

В частности, проблемы Application-defined or object-defined error возникают через:

  • Недопустимая или поврежденная запись Application-defined or object-defined error.
  • Вредоносные программы заразили Application-defined or object-defined error, создавая повреждение.
  • Application-defined or object-defined error злонамеренно или ошибочно удален другим программным обеспечением (кроме Microsoft Excel).
  • Другая программа находится в конфликте с Microsoft Excel и его общими файлами ссылок.
  • Поврежденная загрузка или неполная установка программного обеспечения Microsoft Excel.

Продукт Solvusoft

Загрузка
WinThruster 2022 — Проверьте свой компьютер на наличие ошибок.

Совместима с Windows 2000, XP, Vista, 7, 8, 10 и 11

Установить необязательные продукты — WinThruster (Solvusoft) | Лицензия | Политика защиты личных сведений | Условия | Удаление

 Summary:

In this post, I have included the complete information about Excel runtime error 1004. Besides that I have presented some best fixes to resolve runtime error 1004 effortlessly.

To fix Runtime Error 1004 in Excel you can take initiatives like uninstalling Microsoft Work, creating a new Excel template, or deleting The “GWXL97.XLA” File. If you don’t have any idea on how to apply these methods then go through this post.

Here in this article, we are going to discuss different types of VBA runtime error 1004 in Excel along with their fixes.

What Is Runtime Error 1004 In VBA Excel?

Excel error 1004 is one such annoying runtime error that mainly encounters while working with the Excel file. Or while trying to generate a Macro in Excel document and as a result, you are unable to do anything in your workbook.

This error may cause serious trouble while you are working with Visual Basic Applications and can crash your program or your system or in some cases, it freezes for some time. This error is faced by any versions of MS Excel such as Excel 2007/2010/2013/2016/2019 as well.

To recover lost Excel data, we recommend this tool:

This software will prevent Excel workbook data such as BI data, financial reports & other analytical information from corruption and data loss. With this software you can rebuild corrupt Excel files and restore every single visual representation & dataset to its original, intact state in 3 easy steps:

  1. Download Excel File Repair Tool rated Excellent by Softpedia, Softonic & CNET.
  2. Select the corrupt Excel file (XLS, XLSX) & click Repair to initiate the repair process.
  3. Preview the repaired files and click Save File to save the files at desired location.

Error Detail:

Error Code: run-time error 1004

Description: Application or object-defined error

Screenshot Of The Error:

run-time error 1004

Don’t worry you can fix this Microsoft Visual Basic runtime error 1004, just by following the steps mentioned in this post. But before approaching the fixes section catch more information regarding runtime error 1004.

Excel VBA Run Time Error 1004 Along With The Fixes

EXCEL ERRORS

The lists of error messages associated with this Excel error 1004 are:

  1. VB: run-time error ‘1004’: Application-defined or object-defined error
  2. Excel VBA Runtime error 1004 “Select method of Range class failed”
  3. runtime error 1004 method range of object _global failed visual basic
  4. Excel macro “Run-time error ‘1004″
  5. Runtime error 1004 method open of object workbooks failed
  6. Run time error ‘1004’: Method ‘Ranger’ of Object’ Worksheet’ Failed
  7. Save As VBA run time Error 1004: Application defined or object defined error

Let’s discuss each of them one by one…!

#1 – VBA Run Time Error 1004: That Name is already taken. Try a different One

This VBA Run Time Error 1004 in Excel mainly occurs at the time of renaming the sheet.

If a worksheet with the same name already exists but still you are assigning that name to some other worksheet. In that case, VBA will throw the run time error 1004 along with the message: “The Name is Already Taken. Try a different one.”

VBA Run Time Error 1004 in Excel 1

Solution: You can fix this error code by renaming your Excel sheet.

#2 – VBA Run Time Error 1004: Method “Range” of object’ _ Global’ failed

This VBA error code mainly occurs when someone tries to access the object range with wrong spelling or which doesn’t exist in the worksheet.

Suppose, you have named the cells range as “Headings,” but if you incorrectly mention the named range then obviously you will get the Run Time Error 1004: Method “Range” of object’ _ Global’ failed error.

VBA Run Time Error 1004 in Excel 2

Solution: So before running the code properly check the name of the range.

# 3 – VBA Run Time Error 1004: Select Method of Range class failed

This error code occurs when someone tries to choose the cells from a non-active sheet.

 Let’s understand with this an example:

Suppose you have selected cells from A1 to A5 from the Sheet1 worksheet. Whereas, your present active worksheet is Sheet2.

At that time it’s obvious to encounter Run Time Error 1004: Select Method of Range class failed.

VBA Run Time Error 1004 in Excel 3

Solution: To fix this, you need to activate the worksheet before selecting cells of it.

#4 – VBA Runtime Error 1004 method open of object workbooks failed

This specific run time Error 1004 arises when someone tries to open an Excel workbook having the same workbook name that is already open.

In that case, it’s quite common to encounter VBA Runtime Error 1004 method open of object workbooks failed.

VBA Run Time Error 1004 in Excel 4

Solution: Well to fix this, first of all close the already opened documents having a similar name.

#5 – VBA Runtime Error 1004 Method Sorry We Couldn’t Find:

The main reason behind the occurrence of this VBA error in Excel is due to renaming, shifting, or deletion of the mentioned path.

The reason behind this can be the wrong assigned path or file name with extension.

When your assigned code fails to fetch a file within your mentioned folder path. Then you will definitely get the runtime Error 1004 method. Sorry, and We couldn’t find it.

VBA Run Time Error 1004 in Excel 5

Solution: make a proper check across the given path or file name.

#6 – VBA Runtime Error 1004 Activate method range class failed

Behind this error, the reason can be activating the cells range without activating the Excel worksheet.

This specific error is quite very similar to the one which we have already discussed above i.e Run Time Error 1004: Select Method of Range class failed.

VBA Run Time Error 1004 in Excel 6

Solution: To fix this, you need to activate your excel sheet first and then activate the sheet cells. However, it is not possible to activate the cell of a sheet without activating the worksheet.

Why This Visual Basic Runtime Error 1004 Occurs?

Follow the reasons behind getting the run time error 1004:

  1. Due to corruption in the desktop icon for MS Excel.
  2. Conflict with other programs while opening VBA Excel file.
  3. When filtered data is copied and then pasted into MS Office Excel workbook.
  4. Due to application or object-defined error.
  5. A range value is set programmatically with a collection of large strings.

Well, these are common reasons behind getting the VBA runtime error 1004, now know how to fix it. Here we have described both the manual as well as automatic solution to fix the run time error 1004 in Excel 2016 and 2013. In case you are not able to fix the error manually then make use of the automatic MS Excel Repair Tool to fix the error automatically.

Fix Runtime Error 1004

Follow the steps given below to fix Excel run time error 1004 :

1: Uninstall Microsoft Work

2: Create New Excel Template

3: Delete The “GWXL97.XLA” File

Method 1: Uninstall Microsoft Work

1. Go to the Task Manager and stop the entire running programs.

2. Then go to Start menu > and select Control Panel.

run time error 1004 (1)

3. Next, in the Control Panel select Add or Remove Program.

run time error 1004 (2)

4. Here, you will get the list of programs that are currently installed on your PC, and then from the list select Microsoft Work.

run time error 1004

5. And click on uninstall to remove it from the PC.

It is also important to scan your system for viruses or malware, as this corrupts the files and important documents. You can make use of the best antivirus program to remove malware and also get rid of the runtime error 1004.

Method 2: Create New Excel Template

Another very simple method to fix Excel runtime error 1004 is by putting a new Excel worksheet file within a template. Instead of copying or duplicating the existing worksheet.

Here is the complete step on how to perform this task.

1.Start your Excel application.

2. Make a fresh new Excel workbook, after then delete the entire sheets present on it leaving only a single one.

3. Now format the workbook as per your need or like the way you want to design in your default template.

4. Excel 2003 user: Tap to the File>Save As option

SAVE EXCEL FILE

OR Excel 2007 or latest versions: Tap to the Microsoft Office button after then hit the Save As option.

SAVE EXCEL FILE 1

5. Now in the field of File name, assign name for your template.

6. On the side of Save as type there is a small arrow key, make a tap on it. From the opened drop menu

  • Excel 2003 users have to choose the Excel Template (.xlt)

Create New Excel Template 1

  • And Excel 2007 or later version have to choose the Excel Template (.xltx)

Create New Excel Template 2

7. Tap to the Save.

8. After the successful creation of the template, now you can programmatically insert it by making use of the following code:
Add Type:=pathfilename

Remarks: 

From the above code, you have to replace the pathfilename with the complete path including the file name. For assigning the exact location of the sheet template you have just created.

Method 3: Delete The “GWXL97.XLA” File

Follow another manual method to fix Excel Runtime Error 1004:

1. Right-click on the start menu.

2. Then select the Explore option.

Excel Runtime Error 1004

3. Then open the following directory – C:Program FilesMSOfficeOfficeXLSTART

Excel Runtime Error 1004 (1)

4. Here you need to delete “GWXL97.XLA” file

Excel Runtime Error 1004 (2)

5. And open the Excel after closing the explorer

You would find that the program is running fine without a runtime error. But if you are still facing the error then make use of the automatic MS Excel Repair Tool, to fix the error easily.

Automatic Solution: MS Excel Repair Tool

MS Excel Repair Tool is a professional recommended solution to easily repair both .xls and .xlsx file. It supports several files in one repair cycle. It is a unique tool that can repair multiple corrupted Excel files at one time and also recover everything included charts, cell comments, worksheet properties, and other data. This can recover the corrupt Excel file to a new blank file. It is extremely easy to use and supports both Windows as well as Mac operating systems.

* Free version of the product only previews recoverable data.

Steps to Utilize MS Excel Repair Tool:

Conclusion:

Hope this article helps you to repair the runtime error 1004 in Excel and recovers Excel file data. In this article, we have provided a manual as well as automatic solution to get rid of Excel run-time error 1004. You can make use of any solution according to your desire.

Good Luck!!!

Priyanka is an entrepreneur & content marketing expert. She writes tech blogs and has expertise in MS Office, Excel, and other tech subjects. Her distinctive art of presenting tech information in the easy-to-understand language is very impressive. When not writing, she loves unplanned travels.

Понравилась статья? Поделить с друзьями:
  • Application crashed because a fatal error occurred while checking sound bank files bannerlord
  • Application crash log generated at data nucleus coop как исправить
  • Application closed with error code 4
  • Application ce4e01 exe encountered a serious error and must shut down
  • Application caller error 2023