Ошибка runtime error 1004 что делать

Майкрософт Эксель — одна из самых популярных электронных таблиц, используемых во всем мире как для личных, так и для деловых целей. Это универсальное место для хранения, организации и обработки данных организованным способом. MS Excel поставляется в основном с двумя расширениями, то есть в формате XLS и XLSX. Однако, помимо невероятной популярности, ошибки во время выполнения — обычная неприятность для очень многих пользователей Windows, и одной из самых распространенных является ошибка. Ошибка выполнения 1004.

Ошибка выполнения 1004 в Excel

В этом руководстве мы собираемся обсудить эту распространенную ошибку времени выполнения 1004 и некоторые из лучших исправлений для ее легкого решения.

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

Ошибка выполнения 1004 — это код ошибки, относящийся к Microsoft Visual Basic, который, как известно, беспокоит пользователей Microsoft Excel. С этой ошибкой сталкиваются любые версии MS Excel, такие как Excel 2007, 2010, 2013, 2016, 2019. Ни одна версия Microsoft Excel не застрахована от угрозы Runtime Error 1004.

С этой ошибкой в ​​основном сталкиваются пользователи, когда они работают с файлом Excel или пытаются создать макрос в документе Excel. Это может вызвать серьезные проблемы при работе с приложениями Visual Basic и привести к полному сбою программы или даже всей системы; иногда это может привести к зависанию системы, запрещая пользователям что-либо делать в своей системе.

Типы сообщений об ошибках

Сообщения об ошибках, которые больше всего связаны с этой ошибкой времени выполнения, следующие:

  • VB: ошибка времени выполнения ‘1004’: ошибка приложения или объекта
  • Ошибка выполнения Excel VBA 1004 «Ошибка выбора метода класса Range»
  • ошибка времени выполнения 1004 диапазон метода объекта _global не удалось Visual Basic
  • Макрос Excel «Ошибка выполнения» 1004?
  • Ошибка выполнения 1004 не удалось открыть метод объектных книг
  • Ошибка времени выполнения «1004»: сбой метода «Рейнджер» объекта «Рабочий лист»
  • «Сбой метода в ПРИЛОЖЕНИИ ПРИЛОЖЕНИЯ ОБЪЕКТНОЙ программы».

Если вы столкнулись с какой-либо из этих ошибок, вы можете исправить ее с помощью нашего руководства.

Каковы причины?

Ошибка 1004 — это общий код, связанный с MS Excel, но не связанный с одной точной причиной. Следовательно, в этом случае точная причина, по которой может появиться эта ошибка, будет варьироваться от случая к случаю и от обстоятельств к обстоятельствам. От проблем с конфигурацией до проблем с программным обеспечением, ниже мы перечислили краткий обзор распространенных причин ошибки времени выполнения 1004 в Excel:

  • Значок рабочего стола MS Excel может быть поврежден
  • Файл VBA Excel конфликтует с другим приложением
  • Из-за ошибки, указанной в приложении или объекте
  • Из-за отсутствия зависимого файла
  • Из-за вируса, трояна или вредоносного ПО
  • Из-за неверных ключей реестра и так далее.

Это были некоторые из наиболее частых причин получения ошибки времени выполнения 1004 в MS Excel; Теперь давайте разберемся с различными исправлениями.

Здесь мы подробно описали как ручные, так и автоматические решения для исправления ошибки выполнения 1004. Вы можете использовать любой из следующих методов, чтобы решить проблему.

  1. Создать новый шаблон Excel
  2. Запустите сканирование на вирусы
  3. Для VB: ошибка времени выполнения ‘1004’, измените размер записей легенды

Давайте подробно рассмотрим каждый из этих методов.

1]Создайте новый шаблон Excel

В некоторых случаях для устранения этой проблемы достаточно просто вставить новый лист из шаблона вместо создания копии существующего листа. Вот что вам нужно сделать:

1]Откройте MS Excel в вашей системе

2]Нажмите ‘CTRL + N‘для создания нового листа Microsoft Excel или просто выберите’Пустая книга‘с первого экрана.

Ошибка выполнения 1004

3]После этого удалите все листы в книге, кроме одного.

4]Теперь отформатируйте оставшуюся книгу. Также обратите внимание, что эту книгу можно изменить в соответствии с вашими индивидуальными потребностями.

5]В конце перейдите к ‘Файл> Сохранить как‘, чтобы сохранить новый рабочий лист в формате файла шаблона Excel (.xltx или .xlt).

6]После успешного создания шаблона вы можете вставить его программно, используя следующую строку кода:

Таблицы.Добавить Тип: = путь имя файла

Пожалуйста, обрати внимание — Не забудьте заменить новое имя файла на настоящее имя документа.

2]Запустите сканирование на вирусы

Очень важно сканировать компьютерную систему на наличие вредоносных программ и вирусов, поскольку они могут повредить файлы и важные документы и показать ошибку времени выполнения 1004 в MS Excel. Иногда очень помогает хорошая антивирусная программа.

3]Для VB: ошибка времени выполнения «1004», измените размер записей легенды.

Если вы столкнулись с ошибкой времени выполнения 1004 при запуске макроса Microsoft Visual Basic для приложений (VBA), вы можете использовать этот метод для временного решения.

Обычно эта ошибка возникает при попытке запустить макрос VBA, который использует метод LegendEntries для внесения изменений в записи легенды на диаграмме Microsoft Excel. На этот раз вы можете получить следующее сообщение об ошибке:

Ошибка времени выполнения ‘1004’: ошибка приложения или объекта

Эта ошибка возникает, когда диаграмма Excel содержит больше записей легенды, чем имеется место для отображения записей легенды на диаграмме Excel. В этом случае Microsoft Excel может усекать записи легенды.

Чтобы обойти это поведение, создайте макрос, который уменьшает размер шрифта текста легенды диаграммы Excel до того, как макрос VBA внесет изменения в легенду диаграммы, а затем восстановите размер шрифта легенды диаграммы, чтобы он был похож на следующий пример макроса. .

Sub ResizeLegendEntries()
With Worksheets("Sheet1").ChartObjects(1).Activate
      ' Store the current font size
      fntSZ = ActiveChart.Legend.Font.Size
'Temporarily change the font size.
      ActiveChart.Legend.Font.Size = 2
'Place your LegendEntries macro code here to make
         'the changes that you want to the chart legend.
' Restore the font size.
      ActiveChart.Legend.Font.Size = fntSZ
   End With
End Sub

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

Читать дальше: Клавиши со стрелками не работают в Microsoft Excel.

Ошибка выполнения 1004

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 FilesMS OfficeOfficeXLSTART…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. EaseUS file repair tool 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.

How to Fix Excel Error 104

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:

  1. Runtime error 1004: Application or object-defined error.
  2. Runtime error 1004: Method Ranger of Object Worksheet failed.
  3. 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 FilesMS OfficeOfficeXLSTART.

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.

Enter Excel Option

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:

  1. Runtime error 1004: Application or object-defined error.
  2. Runtime error 1004: Method Ranger of Object Worksheet failed.
  3. 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 FilesMS OfficeOfficeXLSTART.

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.

Enter Excel Option

Step 3. Find and enter the Trust Center Settings.

Enter Trust Center Settings

Step 4. Under Macro Settings, tick the option of «Trust access to the VBA project object model.»

Trust Access to the VBA Project

Step 4. Under Macro Settings, tick the option of «Trust access to the VBA project object model.»

Trust Access to the VBA Project

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 Save As

Excel 2003: Choose Excel 97-2003 Template.

Excel 2007 or Later: Choose Excel Template.

Choose the Right Template

Excel 2003: Choose Excel 97-2003 Template.

Excel 2007 or Later: Choose Excel Template.

Choose the Right Template

Step 4. Click «Save» to confirm.

Now you can insert it programmatically by using the following code: Add Type:=pathfilename. 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. EaseUS Data Recovery Wizard 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. Launch EaseUS Data Recovery Wizard, and then scan disk with corrupted documents. This software enables you to fix damaged Word, Excel, PPT, and PDF files in same steps. 

select the disk with corrupted documents

Step 2. EaseUS data recovery and repair tool will scan for all lost and corrupted files. You can find the target files by file type or type the file name in the search box. 

find corrupted documents

Step 2. EaseUS data recovery and repair tool will scan for all lost and corrupted files. You can find the target files by file type or type the file name in the search box. 

find corrupted documents

Step 3. EaseUS Data Recovery Wizard can repair your damaged documents automatically. After file preview, you can click «Recover» to save the repaired Word, Excel, and PDF document files to a safe location.

repair corrrupt documents

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. EaseUS file repair software is highly recommended by many users & IT professionals to help you repair Word, Excel, PowerPoint, and PDF files. 

 

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. EaseUS file repair software is highly recommended by many users & IT professionals to help you repair Word, Excel, PowerPoint, and PDF files. 

 

Возникает при переходе по ссылке из одного листа на другой

 

Сергей

Пользователь

Сообщений: 11251
Регистрация: 01.01.1970

Юрий я не рунописец но пока начинаю это читать

1004 Ошибка, определенная приложением или объектом. Довольно распространенное универсальное сообщение об ошибке. Данная ошибка возникает тогда, когда ошибка генерируется не в VBA. Другими словами, ошибка определяется в Excel (или в другом объекте) и передается в VBA. Также эта ситуация возникает в случае если ошибка генерируется специально (для этого используется метод Raise объекта Err), но она не определена в VBA

Прикладывайте примеры

Лень двигатель прогресса, доказано!!!

 

Юрий М

Модератор

Сообщений: 60780
Регистрация: 14.09.2012

Контакты см. в профиле

Юрий, я подправил название темы: так больше конкретики. Ведь с Вашим названием все вопросы по ошибкам можно смело задавать в Вашей теме. Так лучше? Ну почему бы самому не придумать нормальное название?

 

Сергей

Пользователь

Сообщений: 11251
Регистрация: 01.01.1970

Юрий Глодовский, я почему говорю про пример и почему так быстро привел описание ошибки, потому что ща сам сижу втыкаю в неё, так ка записал макрорекодером макрос попытался его усовершенствовать и мне выдает такую фигню и я не думаю что мы с вами делаем одно и тоже

Лень двигатель прогресса, доказано!!!

 

Сергей, пример приложить не могу, так как там у меня вся рабочая база. Пробовал вынести это дело в отдельный файл, но ошибка не возникает, походу это конфликт макросов.
У меня вопрос в какую сторону хотя бы копать.

 

Юрий М

Модератор

Сообщений: 60780
Регистрация: 14.09.2012

Контакты см. в профиле

Начните с того, что прогоните код пошагово: для начала выясним — на какой строке и в какой процедуре возникает эта ошибка.

 

Сергей

Пользователь

Сообщений: 11251
Регистрация: 01.01.1970

#7

16.05.2014 22:53:10

Цитата
Юрий Глодовский пишет: У меня вопрос в какую сторону хотя бы копать.

это не ко мне, сам тупил над такой же ошибкой около 30 минут, грохнул макрос рисую заново, но это чисто развлекуха под пиво к работе у меня ни как не относится

Лень двигатель прогресса, доказано!!!

 

Юрий Глодовский

Пользователь

Сообщений: 137
Регистрация: 17.03.2013

#8

16.05.2014 23:42:20

Юрий М, в третьей строке, тот что If Not Intersect…

Код
Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
    '// Проверяем, что выделенная ячейка пересеклась с колонкой "А"
    If Not Intersect(Target, Columns("C")) Is Nothing And Target.Parent.Name = "База" Then
        '//Проверяем, что это не первая строка (там у нас будет заголовок таблицы)
        If Target.Row <> 1 Then
            If Target.Cells.Count = 1 Then '// Если выделена только одна ячейка
                '// Проверяем, что ячейка не пуста
                If Len(Target.Offset(0, -2).Value) <> 0 Then
                    '// На всякий случай - предотвращение ошибок во время файловых операций
                    On Error Resume Next
                    '// Внимание Mkdir (в отличие от DOS-версии) не умеет создавать цепочку папок
                    '// Это означает, что папка, в которой нужно создавать новую, уже должна существовать
                    Dim HomeDir$
                    HomeDir = "D:Base" '// Задаем исходную папку (у Вас - это: "D:Base")
                    MkDir (HomeDir & "" & Target.Offset(0, -2).Value)
                    If Err = 0 Then Cells(Target.Row, "C").Formula = "=HYPERLINK(""" & HomeDir & """&A" & Target.Row & ",""IIIII"")"
                End If
            End If
        End If
    End If
End Sub
 
 

Сергей

Пользователь

Сообщений: 11251
Регистрация: 01.01.1970

#9

16.05.2014 23:44:38

Цитата
Юрий М пишет: Начните с того, что прогоните код пошагово: для начала выясним — на какой строке и в какой процедуре возникает эта ошибка.

Юрий Глодовский, обращайте внимание на советы, если не знаете как это сделать, спрашивайте, дадут либо ссылку либо совет как это сделать, КОТ хоть и сидит со скелетом но форумчан редко ест

Лень двигатель прогресса, доказано!!!

 

Hugo

Пользователь

Сообщений: 23374
Регистрация: 22.12.2012

#10

16.05.2014 23:46:23

У меня нет ошибки.
Но попробуйте

Код
    If Not Intersect(Target, ActiveSheet.Columns("C")) Is Nothing And Target.Parent.Name = "База" Then 

кто его знает…
или

Код
    If Not Intersect(Target, target.parent.Columns(3)) Is Nothing And Target.Parent.Name = "База" Then 

Изменено: Hugo17.05.2014 08:31:16

 

Юрий М

Модератор

Сообщений: 60780
Регистрация: 14.09.2012

Контакты см. в профиле

Без файла сложно, конечно… Лист «База» есть?

 

Hugo

Пользователь

Сообщений: 23374
Регистрация: 22.12.2012

Юра, у меня листа База не было. В начале :)
Это не влияет. Нет листа — не выполняется условие всего лишь…

 

Сергей

Пользователь

Сообщений: 11251
Регистрация: 01.01.1970

вообще не уверен но со своей ошибкой кажись разобрался я когда писал рекодером копировал формулы из одного документа в другой, когда они оба были открыты макрос работал, после того как я закрыл файл из которого копировал формулы начал запускать макрос начала вылетать эта ошибка

Лень двигатель прогресса, доказано!!!

 

Юрий Глодовский

Пользователь

Сообщений: 137
Регистрация: 17.03.2013

#14

17.05.2014 00:00:16

Цитата
Hugo пишет: If Not Intersect(Target, target.parent.Columns(3)) Is Nothing And Target.Parent.Name = «База» Then

Этот вариант помог. Большое спасибо.
Сергей, посмотрите, может вам пригодится.

 

Юрий М

Модератор

Сообщений: 60780
Регистрация: 14.09.2012

Контакты см. в профиле

#15

17.05.2014 00:02:43

Немного смущает несоответствие комментария и строки кода. Комментарий ошибку не вызовет, но всё же:

Код
'// Проверяем, что выделенная ячейка пересеклась с колонкой "А" 

А проверяем столбец С.

 

Сергей

Пользователь

Сообщений: 11251
Регистрация: 01.01.1970

#16

17.05.2014 00:13:50

Цитата
Юрий Глодовский пишет: может вам пригодится.

в будущем может, на данном моменте эволюции понимания в VBA у меня даже таких строк нет

Лень двигатель прогресса, доказано!!!

 

Казанский

Пользователь

Сообщений: 8839
Регистрация: 11.01.2013

#17

17.05.2014 01:13:52

Замечу, что Target.Parent это Sh, который передается в процедуру.
Лучше разбить первую проверку на две, чтобы сначала шла быстрая операция сравнения имени, а потом громоздкий Intersect:

Код
If Sh.Name = "База" Then
  If Not Intersect(Target, Sh.Columns(3)) Is Nothing Then 

3 простых способа исправить ошибку времени выполнения Excel 1004 в Windows 10

Ошибка выполнения Excel 1004 обычно возникает, когда вы работаете с поврежденным документом. Вы также получаете эту ошибку, если открываете файл VBA Excel, когда ваш Excel конфликтует с другими программами.

Ошибка выполнения Excel 1004 может появиться из-за множества других основных проблем. Наиболее распространенные сообщения об ошибках включают следующее:

VB: ошибка времени выполнения «1004»: ошибка, определяемая приложением или объектом

Ошибка выполнения Excel VBA 1004 «Не удалось выбрать метод класса Range»

ошибка выполнения 1004 диапазон методов объекта _global не удалось Visual Basic

Макрос Excel «Ошибка выполнения ‘1004″

Ошибка выполнения 1004. Не удалось открыть книгу объектов.

Ошибка времени выполнения «1004»: сбой метода «Рейнджер» рабочего листа объекта

Сохранить как ошибка времени выполнения VBA 1004: ошибка, определяемая приложением или объектом

Если вы получите какую-либо из этих ошибок, вы можете исправить ошибку, используя решения здесь.

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

Ошибка времени выполнения характерна для приложений, которые интегрируют сценарий Microsoft Visual Basic для приложений (также известный как VBA) для выполнения повторяющихся задач.

Все приложения Microsoft Office используют это специфичное для Windows программирование, но наиболее распространенные проблемы возникают в Excel, особенно в Excel 2007.

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

Часто эта задача конфликтует с VBA, что приводит к ошибке 1004. Другой распространенной причиной является поврежденное приложение Excel или поврежденный файл XLS.

Другие возможные причины, связанные с этой ошибкой, включают количество записей легенды, превышающее доступное пространство, и конфликт файлов между Excel и другими приложениями.

Хорошей новостью является то, что эта ошибка существует уже некоторое время, и есть несколько проверенных методов, которые помогут вам ее исправить.

Как исправить ошибку выполнения 1004 в Excel?

1. Удалите Microsoft Works

  • Нажмите комбинацию CTRL + ALT + DEL и нажмите  «Диспетчер задач».
  • Закройте все программы, которые открыты в данный момент.
  • Затем нажмите Windows + R, чтобы открыть утилиту «Выполнить».
  • Здесь введите  appwiz.cpl и нажмите  кнопку ОК.

  • В списке программ, установленных на вашем компьютере, найдите  Microsoft Works. Щелкните его правой кнопкой мыши и нажмите «  Удалить».

2. Создайте еще один шаблон Excel

  • Запустите Microsoft Excel на своем компьютере.
  • Затем создайте новую книгу Microsoft Excel, нажав комбинацию CTRL + N или выбрав Пустая книга на первом экране.

  • После создания рабочей книги удалите все листы в рабочей книге, кроме одного.
  • Отформатируйте эту книгу, которую вы сохранили.
    • Вы можете изменить эту книгу в соответствии с вашими потребностями.
  • Наконец, выберите «Файл» > «Сохранить как», чтобы сохранить файл в формате  шаблона Excel (.xltx или. xlt).
    • Используйте этот формат для Excel в 2017 году и выше.
  • Когда документ успешно сохранен, вы можете вставить шаблон с помощью этого кода:
    Add Type:=pathfilename

    Не забудьте заменить имя файла на фактическое имя документа.

3. Удалите GWXL97.XLA.

  • Начните с открытия  проводника на вашем компьютере.
    • Вы можете сделать это, нажав  Windows E.
  • Затем щелкните адресную строку, введите следующий путь
    C:/Users/user name/AppData/Local/Microsoft Excel
    и нажмите  Enter:

  • Здесь откройте  папку XLStart.
  • Наконец, найдите файл GWXL97.XLA и удалите его.

Зная, что существует множество причин ошибки времени выполнения 1004 в Excel, может сработать только одно решение. С помощью этого руководства теперь вы можете исправить ошибку времени выполнения Microsoft Excel 1004 и восстановить данные файла.

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 FilesMS OfficeOfficeXLSTART…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. EaseUS file repair tool 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.

How to Fix Excel Error 104

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:

  1. Runtime error 1004: Application or object-defined error.
  2. Runtime error 1004: Method Ranger of Object Worksheet failed.
  3. 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 FilesMS OfficeOfficeXLSTART.

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.

Enter Excel Option

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:

  1. Runtime error 1004: Application or object-defined error.
  2. Runtime error 1004: Method Ranger of Object Worksheet failed.
  3. 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 FilesMS OfficeOfficeXLSTART.

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.

Enter Excel Option

Step 3. Find and enter the Trust Center Settings.

Enter Trust Center Settings

Step 4. Under Macro Settings, tick the option of «Trust access to the VBA project object model.»

Trust Access to the VBA Project

Step 4. Under Macro Settings, tick the option of «Trust access to the VBA project object model.»

Trust Access to the VBA Project

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 Save As

Excel 2003: Choose Excel 97-2003 Template.

Excel 2007 or Later: Choose Excel Template.

Choose the Right Template

Excel 2003: Choose Excel 97-2003 Template.

Excel 2007 or Later: Choose Excel Template.

Choose the Right Template

Step 4. Click «Save» to confirm.

Now you can insert it programmatically by using the following code: Add Type:=pathfilename. 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. EaseUS Data Recovery Wizard 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. Launch EaseUS Data Recovery Wizard, and then scan disk with corrupted documents. This software enables you to fix damaged Word, Excel, PPT, and PDF files in same steps. 

select the disk with corrupted documents

Step 2. EaseUS data recovery and repair tool will scan for all lost and corrupted files. You can find the target files by file type or type the file name in the search box. 

find corrupted documents

Step 2. EaseUS data recovery and repair tool will scan for all lost and corrupted files. You can find the target files by file type or type the file name in the search box. 

find corrupted documents

Step 3. EaseUS Data Recovery Wizard can repair your damaged documents automatically. After file preview, you can click «Recover» to save the repaired Word, Excel, and PDF document files to a safe location.

repair corrrupt documents

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. EaseUS file repair software is highly recommended by many users & IT professionals to help you repair Word, Excel, PowerPoint, and PDF files. 

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 FilesMS OfficeOfficeXLSTART…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. EaseUS file repair tool 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.

How to Fix Excel Error 104

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. EaseUS file repair software is highly recommended by many users & IT professionals to help you repair Word, Excel, PowerPoint, and PDF files. 

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 FilesMS OfficeOfficeXLSTART…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. EaseUS file repair tool 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.

How to Fix Excel Error 104

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:

  1. Runtime error 1004: Application or object-defined error.
  2. Runtime error 1004: Method Ranger of Object Worksheet failed.
  3. 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 FilesMS OfficeOfficeXLSTART.

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.

Enter Excel Option

Step 3. Find and enter the Trust Center Settings.

Enter Trust Center Settings

Step 3. Find and enter the Trust Center Settings.

Enter Trust Center Settings

Step 4. Under Macro Settings, tick the option of «Trust access to the VBA project object model.»

Trust Access to the VBA Project

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 Save As

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 Save As

Excel 2003: Choose Excel 97-2003 Template.

Excel 2007 or Later: Choose Excel Template.

Choose the Right Template

Step 4. Click «Save» to confirm.

Now you can insert it programmatically by using the following code: Add Type:=pathfilename. 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. EaseUS Data Recovery Wizard 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. Launch EaseUS Data Recovery Wizard, and then scan disk with corrupted documents. This software enables you to fix damaged Word, Excel, PPT, and PDF files in same steps. 

select the disk with corrupted documents

Step 4. Click «Save» to confirm.

Now you can insert it programmatically by using the following code: Add Type:=pathfilename. 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. EaseUS Data Recovery Wizard 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. Launch EaseUS Data Recovery Wizard, and then scan disk with corrupted documents. This software enables you to fix damaged Word, Excel, PPT, and PDF files in same steps. 

select the disk with corrupted documents

Step 2. EaseUS data recovery and repair tool will scan for all lost and corrupted files. You can find the target files by file type or type the file name in the search box. 

find corrupted documents

Step 3. EaseUS Data Recovery Wizard can repair your damaged documents automatically. After file preview, you can click «Recover» to save the repaired Word, Excel, and PDF document files to a safe location.

repair corrrupt documents

Step 3. EaseUS Data Recovery Wizard can repair your damaged documents automatically. After file preview, you can click «Recover» to save the repaired Word, Excel, and PDF document files to a safe location.

repair corrrupt documents

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. EaseUS file repair software is highly recommended by many users & IT professionals to help you repair Word, Excel, PowerPoint, and PDF files. 

Ошибка выполнения Excel 1004 обычно возникает, когда вы работаете с поврежденным документом. Вы также получаете эту ошибку, если открываете файл VBA Excel, когда ваш Excel конфликтует с другими программами.

Ошибка выполнения Excel 1004 может появиться из-за множества других основных проблем. Наиболее распространенные сообщения об ошибках включают следующее:

VB: ошибка времени выполнения «1004»: ошибка, определяемая приложением или объектом

Ошибка выполнения Excel VBA 1004 «Не удалось выбрать метод класса Range»

ошибка выполнения 1004 диапазон методов объекта _global не удалось Visual Basic

Макрос Excel «Ошибка выполнения ‘1004″

Ошибка выполнения 1004. Не удалось открыть книгу объектов.

Ошибка времени выполнения «1004»: сбой метода «Рейнджер» рабочего листа объекта

Сохранить как ошибка времени выполнения VBA 1004: ошибка, определяемая приложением или объектом

Если вы получите какую-либо из этих ошибок, вы можете исправить ошибку, используя решения здесь.

Ошибка времени выполнения характерна для приложений, которые интегрируют сценарий Microsoft Visual Basic для приложений (также известный как VBA) для выполнения повторяющихся задач.

Все приложения Microsoft Office используют это специфичное для Windows программирование, но наиболее распространенные проблемы возникают в Excel, особенно в Excel 2007.

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

Часто эта задача конфликтует с VBA, что приводит к ошибке 1004. Другой распространенной причиной является поврежденное приложение Excel или поврежденный файл XLS.

Другие возможные причины, связанные с этой ошибкой, включают количество записей легенды, превышающее доступное пространство, и конфликт файлов между Excel и другими приложениями.

Хорошей новостью является то, что эта ошибка существует уже некоторое время, и есть несколько проверенных методов, которые помогут вам ее исправить.

Как исправить ошибку выполнения 1004 в Excel?

1. Удалите Microsoft Works

  • Нажмите комбинацию CTRL + ALT + DEL и нажмите  «Диспетчер задач».
  • Закройте все программы, которые открыты в данный момент.
  • Затем нажмите Windows + R, чтобы открыть утилиту «Выполнить».
  • Здесь введите  appwiz.cpl и нажмите  кнопку ОК.

  • В списке программ, установленных на вашем компьютере, найдите  Microsoft Works. Щелкните его правой кнопкой мыши и нажмите «  Удалить».

2. Создайте еще один шаблон Excel

  • Запустите Microsoft Excel на своем компьютере.
  • Затем создайте новую книгу Microsoft Excel, нажав комбинацию CTRL + N или выбрав Пустая книга на первом экране.

  • После создания рабочей книги удалите все листы в рабочей книге, кроме одного.
  • Отформатируйте эту книгу, которую вы сохранили.
    • Вы можете изменить эту книгу в соответствии с вашими потребностями.
  • Наконец, выберите «Файл» > «Сохранить как», чтобы сохранить файл в формате  шаблона Excel (.xltx или. xlt).
    • Используйте этот формат для Excel в 2017 году и выше.
  • Когда документ успешно сохранен, вы можете вставить шаблон с помощью этого кода:
    Add Type:=pathfilename

    Не забудьте заменить имя файла на фактическое имя документа.

3. Удалите GWXL97.XLA.

  • Начните с открытия  проводника на вашем компьютере.
    • Вы можете сделать это, нажав  Windows E.
  • Затем щелкните адресную строку, введите следующий путь
    C:/Users/user name/AppData/Local/Microsoft Excel
    и нажмите  Enter:

  • Здесь откройте  папку XLStart.
  • Наконец, найдите файл GWXL97.XLA и удалите его.

Зная, что существует множество причин ошибки времени выполнения 1004 в Excel, может сработать только одно решение. С помощью этого руководства теперь вы можете исправить ошибку времени выполнения Microsoft Excel 1004 и восстановить данные файла.


 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!!!

Summary

How To Repair Runtime Error 1004 In Excel

Article Name

How To Repair Runtime Error 1004 In Excel

Description

Try best fixes to resolve Excel runtime error 1004. METHOD 1: Uninstall Microsoft Work, METHOD 2: Create New Excel Template, METHOD 3: Delete The «GWXL97.XLA” File AND MORE…

Author

Publisher Name

Repair MS Excel Blogs

Publisher Logo

Repair MS Excel Blogs

Priyanka Sahu

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.

С самого начала Microsoft предоставила нам множество полезных приложений. В свое время приложения стали частью Microsoft Office. Microsoft Excel — одно из таких приложений, которое существует с первых дней существования компьютеров, и это программа, которая позволяет пользователям систематизировать формат и вычислять данные. Более того, он позволяет пользователям использовать формулы, используя систему электронных таблиц. Microsoft Excel используется многочисленными компаниями по всему миру для выполнения финансового анализа. Более того, MS Excel также поддерживает приложения Visual Basic, что означает, что вы можете добавить скрипт VBA, прикрепленный к вашей электронной таблице.

Другие офисные программы и MS Excel используют код VBA для множества функций, например, вы можете добавить кнопку в электронную таблицу, которая автоматически добавит данные. Такие функции очень полезны, когда вы собираетесь управлять большим объемом данных. Однако пользователи часто сообщают об ошибках, что у них есть лицо. Здесь мы обсуждаем конкретную ошибку времени выполнения VBA 1004. Возможные причины ошибки времени выполнения 1004 VBA — неверный синтаксис или код, отфильтрованные данные, повреждение MS Excel. Однако также возможно, что две программы конфликтуют при попытке открыть файл VBA одновременно.

Как исправить ошибку времени выполнения VBA 1004?

Оглавление

  • 1 Как исправить ошибку времени выполнения VBA 1004?
    • 1.1 Способ 1. Создать новый шаблон
    • 1.2 Способ 2. Удаление файла GWXL97.XLA
    • 1.3 Способ 3. Отладить код
  • 2 Вывод

Как исправить ошибку времени выполнения VBA 1004?

Есть несколько методов, с помощью которых вы можете попытаться решить проблему времени выполнения VBA самостоятельно. Список решений приведен ниже.

Способ 1. Создать новый шаблон

Помещение нового листа Excel в шаблон вместо копирования или дублирования существующего листа может решить проблему. Поэтому сначала попробуйте это.

Шаг 1) Сначала запустите Microsoft Excel и создайте новую книгу, затем удалите существующий лист, оставив только один. Вы можете отформатировать как хотите, чтобы создать шаблон по умолчанию. Нажмите на файл вариант в строке меню и выберите Сохранить как вариант.

Как исправить ошибку времени выполнения VBA 1004?

Шаг 2) Выберите Книга Excel опция, откроется окно файлового менеджера. Выберите каталог, в котором вы хотите сохранить свой шаблон.

Как исправить ошибку времени выполнения VBA 1004?

Шаг 3) Введите имя шаблона, затем выберите тип файла как .xlt для Excel 2003 и .xltx для Excel 2007 или новее. Нажми на Сохранить кнопку, и ваш шаблон будет сохранен. Теперь попробуйте запустить код VBA.

Способ 2. Удаление файла GWXL97.XLA

Если несколько программ попытаются открыть файл VBA одновременно, конфликт обязательно возникнет, поэтому, чтобы убедиться в отсутствии конфликта, вы можете попробовать удалить файл GWXL97.XLA.

Шаг 1) Откройте Проводник.

Шаг 2) Перейдите в следующий каталог —

C: Program Files MSOffice Office XLSTART

Шаг 3) Вы увидите файл GWXL97.XLA в папке, выберите и нажмите кнопку удаления на клавиатуре или щелкните правой кнопкой мыши и выберите удалить. Теперь попробуйте запустить код VBA.

Способ 3. Отладить код

Вполне возможно, что ошибка 1004 возникает из-за неверного кода. Поэтому вам нужно будет написать правильный синтаксис и значение, чтобы код VBA отлично выполнялся. Может быть множество ошибок, которые могут быть результатом ошибки 1004, чтобы этого не произошло, вам нужно дважды проверить свой код и указать недопустимые строки. Например, Имя уже занято сообщение отображается с ошибкой 1004, если имя рабочего листа уже существует, и ему присвоено то же имя другому.

Если вы запустите код, он выдаст сообщение об ошибке 1004, поэтому попробуйте изменить имя и присвоить значения. Есть еще 1004 ошибки, связанные с недопустимым кодом VBA, например, сбой в диапазоне object_Global, поле класса Select Method of Range и многое другое. Каждый раз, когда будет отображаться сообщение, ошибки будут выделены ошибкой 1004, если ошибка связана с кодом VBA. Поэтому отлаживайте код с правильным синтаксисом и значениями.

Вывод

Код ошибки 1004 в Ms. Excel можно глупо исправить, отладив коды, исправив неверные строки, имена и значения. Более того, если проблема не связана с кодом, вы можете удалить файл XLA, который может конфликтовать с MS Excel при открытии файла VBA. Кроме того, вы можете попытаться создать новый шаблон с существующей Рабочей книгой, чтобы устранить проблему.

Выбор редактора:

  • Показывать дату значка панели задач Windows 10 маленькими значками
  • Изменить скорость курсора в последней версии Windows 10 2004
  • Открывайте торрент-файлы в Windows 10 или macOS
  • Как исправить ошибку «Расширение панели управления несовместимо с версией драйвера»
  • Сделайте снимок экрана с видео YouTube

Рахул изучает информатику и проявляет огромный интерес к темам в области технологий и криптовалюты. Большую часть времени он пишет, слушает музыку или путешествует по незнакомым местам. Он считает, что шоколад — это решение всех его проблем. Жизнь бывает, и кофе помогает.

Формулы в Excel приводят к ошибке «Run-time error »1004»»

​Смотрите также​​ в каких-то случаях,​ значение «free» если​ ячеек With Sheets(SheetName).Range(«A1»)​ строки по этим​
​ For​ наизусть выучить. Их​ кроме кнопки и​ людей просто игнорируют.​ lr As Long​ 424 — Object​ правильном направлении!​: Большое спасибо. Оба​Sheets(«Задолженность»).Cells(9, 7).Value =​Application.ScreenUpdating = False​ макросах я профан,​ End With End​Nastinya​
​ то да, нужно​ нету то iserr​
​ .PasteSpecial Paste:=xlPasteFormulas ‘шапка​ листам.​Next i​ не так много.​
​ код к этой​ Это не связано​ Application.ScreenUpdating = False​ required. в строке​

​korsar75​​ метода работают. Если​ Sheets(«Договор, акт»).Cells(18, 11).Value​Dim wsSh As​ поэтому объясните что​ Sub​: Добрый день. никак​ обрабатывать ошибку. Но​ — вернет true.​ содержит формулы, которые​Макрос запускается по​Range(«count»).Value = 0​ Без файла с​ кнопки пока выглядит​ с ленью или​ Set shSource =​ If Not Intersect(cell,​: Большое спасибо. Будем​

​ не сложно, то​​Sheets(«Задолженность»).Cells(9, 8).Value =​ Worksheet​

​ дает данная команда​Прим.:​ не могу разобраться,​
​ некоторые функции рабочего​
​PS знаю что​
​ тоже копируются .PasteSpecial​ кнопке (взята из​Application.DisplayAlerts = True​ проблемой разговор неочем.​ точно так же,​ не желанием. Это​​ Worksheets(«Ввод результатов испытаний»)​​ [C11], [C62:C65]​ дальше грызть гранит​​ в двух словах​​ Sheets(«Договор, акт»).Cells(16, 11).Value​For Each wsSh​ «CStr» для дальнейшего​используется​
​ потерялась в двух​​ листа не возвращают​​ есть куча способов​
​ Paste:=xlPasteFormats .PasteSpecial Paste:=xlPasteColumnWidths​​ «элементов управления формы»).​
​Application.ScreenUpdating = True​ Может у Вас​ как я выложил​ связанно с избыточным​ Set shTarget =​Private Sub Worksheet_Change(ByVal​​ науки​​ в чем моя​​End Sub​​ In Me.Sheets​ понимания и использования​​Index​​ строках.​​ ошибки, например СЧЕТЕСЛИ,​​ это сделать, но​​ End With With​​На моей машине​
​End Sub​
​ в Range(«B3»).Select буква​ в изображении. То​ количеством правил. На​ Worksheets(«данные») lr =​ Target As Range)​max_2311​ ошибка или пошлите​
​Pelena​If wsSh.Name <>​LVL​листа, но можно​Adr = Worksheets(NameStel).Cells(Stroka​ поэтому для таких​ хочу понять что​

CyberForum.ru

Макрос, ошибка 1004

​ Application .ScreenUpdating =​​ в версии 2007​собственно, нужно, чтобы​ B не латинская,​ есть все что​ каждом сайте свои​ shTarget.Columns(«A»).Find(What:=»*», LookIn:=xlFormulas, LookAt:=​ Application.DisplayAlerts = False​: Извините, но ошибка​ куда-нибудь, где про​:​ «Прочее» And wsSh.Name​: Это не команда,​ вместо​ + 6, i).Address(RowAbsolute:=False,ColumnAbsolute:=False,External:=True)​ функций не нужна​ не так именно​ False: .CutCopyMode =​

​ всё работает, на​​ при обращении к​ а кириллическая?​ есть в изображении​ правила и тонкости,​ _ xlPart, SearchOrder:=xlByRows,​;)
​ For Each cell​ опять проявилась. В​ это написано :-)​Тагир​

​ <> «Цель кредита»​​ а функция. Она​Index​ Sheets(«данные»).Range(«E3»).Formula = «=»​ обработка ошибок.​ с данным вариантом.​ False End WithМожет​ машине начальника в​ несуществующей странице код​Kimezz​ (если не считать​ а их миллионы.​

​ SearchDirection:=xlPrevious, MatchCase:=False _​​ In Target If​ коде выделяется .Value=Now​:)
​ (но лучше с​, оформите код тегами​

​ Then​​ приводит выражение к​использовать имя -​ & Adrв первой​xlankasterx​Большое спасибо!​ в самой кнопке​ версии 2013 при​ игнорировал ошибку и,​

​: коллеги, добрый день,​​ одной кнопки на​ Жизни не хватит,​ , SearchFormat:=False).Row +​ Not Intersect(cell, [C11],​;)

​Подскажи где ошибка​​ конкрентным указанием книжки​ с помощью кнопки​wsSh.EnableOutlining = True​ типу String​1​:)​ строчке получаю адрес​: Последний вопрос и​SuperCat​ есть какая-нибудь особенность?​

​ запуске из Microsoft​​ увеличив счетчик, переходил​столкнулся с проблемой,​ странице) является и​:)

planetaexcel.ru

Макрос выдаёт ошибку 1004 (Макросы/Sub)

​ чтобы все правила​​ 1 shSource.Range(«D1:D83»).Copy ‘shTarget.Cells(lr,​ [C62:C65]) Is Nothing​ в коде?​
​ или статьи)​
​ # в режиме​
​DO_ = True​Ирина​
​заменяем на​ ячейки с одного​
​ тема закрыта):​: А причём тут​Hugo​
​ Visual Basic тоже​ к следующей дате​ гугл не очень​
​ так 100% всей​
​ перечитать. А помимо​ "A").PasteSpecial Paste:=xlPasteAll, Transpose:=True​ Then ' End​
​Private Sub Worksheet_Change(ByVal​Sergei_A​ правки поста​
​If wsSh.Name =​
​: Ну теперь все​
​"данные"​ листа и затем​On Error Resume​
​ IsErr и проверка​
​: Были глюки с​
​ работает, а при​
​ (дата, и вслед​
​ помог, надеюсь на​

​ информации? Может вам​ правил на сайтах​ shTarget.Cells(lr, «A»).PasteSpecial Paste:=xlPasteValues,​
​ If Next cell​ Target As Range)​: Держите​Тагир​ «Консолидация» Then DO_​ понятно, а то​.Всем большое спасибо.​

​ этот адрес надо​​ Next​​ ячейки на значение?​​ этими кнопками после​ запуске через кнопку​

​ за ней адрес​​ вас.​ еще весь жесткий​
​ в жизни нас​
​ Transpose:=True Application.CutCopyMode =​
​ Application.DisplayAlerts = TrueEnd​
​ Application.DisplayAlerts = False​В двух словах​
​: Добрый день!!!​ = False​
​ очень тяжело когда​помогло:​ вставить в формулу​var = Application.WorksheetFunction.Search("free",​
​ В ячейке может​
​ некоторых обновлений, обсуждалось.​
​ с листа выдаёт​ ссылки, меняется в​задача: на сайте​
​ диск на 2Тб​ окружают еще миллионы​ False Application.ScreenUpdating =​
​ Sub​
​ For Each cell​
​ - Вы через​
​Кто может помочь​
​wsSh.Protect Password:="0000", DrawingObjects:=DO_,​

​ не знаешь да​сначала сформировала скобочки​ на другом листе.​ Cells(2, 1), 1)​ быть ошибка?​ Я бы вместо​ ошибку «1004 Application-defined​ экселе при изменении​ публикуются данные раз​ отправить, чтоб вам​ правил, расписывающих чуть​
​ True MsgBox «Сделано»​
​Ранее использовался код,​ In Target If​Set ArtikulRange =​ в устранении ошибки,​

​ Contents:=True, Scenarios:=True, UserinterfaceOnly:=True,​​ еще и забудешь!​ в ячейке, затем​ вот в таком​On Error GoTo​Karataev​ кнопки использовал любой​

excelworld.ru

Как исправить ошибку «Run-time error ‘1004’ (Формулы/Formulas)

​ or object-defined error»​​ значения счетчика).​ в день в​ легче было разобраться​ ли не каждый​ End Sub​ но время не​
​ Not Intersect(cell, Range(«C11,​ Selection​ в экселе никогда​ AllowFormattingRows:=True, AllowFiltering:=True​
​Что бы мы​ добавила к ним​ виде все нормально​ 0​: С помощью «worksheetfunction.iserr»​
​ рисунок (например из​Копирование строки выполняется​
​спасибо!​
​ экселе, при этом​
​ в 4 строчках?​
​ наш шаг: религия,​
​Юрий М​ менялось.​
​ C61:C64″ [IMG WIDTH=16​Создали объект содержащий​
​ не программировал, разбираться​End If​
​ олухи без Вас​ OR. — не​
​ работает.​в чем разница​
​ нельзя перехватить ошибку.​ автофигур).​
​ так:​_Boroda_​
​ нормального доступа ко​

​putevod​​ тысячи федеральных законов,​​: Код следует оформлять​​Private Sub Worksheet_Change(ByVal​ HEIGHT=16]http://www.planetaexcel.ru/bitrix/images/forum/smile/icon_wink.gif[/IMG] ) Is​ выделенный диапазон, и​ с нуля сложно​

​Next wsSh​​ и вашего форума​
​ сработало. затем поменяла​но нужно получить​ между первой и​ Ошибку можно так​А по той​Application.ScreenUpdating = False​
​: Проверяйте файл на​ всей базе данных​: Юрий М, Спасибо!​ этикет, нормы расписанные​ соответствующим тегом: ищите​ Target As Range)​ Nothing Then With​ потом этот объект​ .​Application.ScreenUpdating = True​

​ делали… Спасибо разъяснение.​​ на Local. -​​ формулу ИЛИ.​​ третьей строчкой?​ перехватить:​ строке — Sheets(ActSheetName).Range(Cells(R,​ ‘Эту структуру я​ наличие так​

​ нет.​​ Оба способа не​ для работ (ГОСТы,​

​ такую кнопку и​​ Application.DisplayAlerts = False​ cell.Offset(0, 3) [COLOR=#ff0000]​ пишите как адрес​Особенность заключается в​

​Application.CellDragAndDrop = False​​Юрий М​​ и… УРАА!!​Sheets(«данные»).Range(«E3»).Formula = «=OR(«​Karataev​
​Sub Macro() Dim​ 41), Cells(R, 49)).Copyтам​ взял с какого-то​

excelworld.ru

Ошибка run-time error ‘1004’ в коде

​if dir(ПолныйПутьСИменемИРасширением)<>»» then​​решил выкачать все​
​ вызывают ошибки и​ СНиПы, ПБУ и​
​ исправьте своё сообщение.​ For Each cell​ .Value = Now​ — Range(ArtikulRange)​ том, что данные​End Sub​: В редакторе становимся​хотя пробовала все​ & Adrсразу вылетает​: On Error Resume​ lngVar As Long​
​ не указано чьи​ форума, не очень​

​Kimezz​​ файлы и слить​
​ выполняют то, что​
​ их огромное количество),​
​P.S. Код копируйте​

​ In Target If​​ [/COLOR] End With​korsar75​ договора заполняются в​На всякий случай​ курсором на CStr​ те же действия​ ошибка «Run-time error​ Next — при​ On Error Resume​ ячейки, уже привычная​ понимаю зачем нужна.​

​: _Boroda_, спасибо. к​​ воедино. первый шаг​
​ я хотел!​ правила пользования техникой,​
​ при русской раскладке​ Not Intersect(cell, [C11],​
​ End If Next​: А можно пропустить​ закладке «Договор,акт» -​ (вдруг кто не​ и жмём F1​

​ в обратном порядке​​ »1004»»​ ошибке продолжить далее.​
​ Next lngVar =​ ошибка, аж надоело…​ Sheets(ActSheetName).Range(Cells(R, 41), Cells(R,​ сожалению, не сработало:​ — выкачать файлы,​Юрий М​ безопасность, ПДД, расписание​ клавиатуры — тогда​ [C62:C65]) Is Nothing​ cell Application.DisplayAlerts =​ эти шаги:​ печатается файл, потом​ в курсе) предупрежу,​Almost​ — поставить local​как уже только​ Здесь и так​ Application.WorksheetFunction.Search(«free», Cells(2, 1),​Если код в​ 49)).Copy ‘В листе​ воткнул​ которые называются однотипно.​: Не нужен весь​ дня (тоже извините​ не будет вот​ Then ‘ Cell.Offset(0,​ True End Sub​Worksheets(«Raschet».Activate Worksheets(«Raschet».Range(«A1».Activate Worksheets(«Raschet».Range(ActiveCell,​ необходимо сохранить данные​ что последняя строчка​: Во вложении файл​
​ и формировать формулу​ не извращалась с​ все понятно.​ 1) On Error​ стандартном модуле -​ с именем ActSheetName(переменная)​If Dir(address) <> «»​ выходные дни игнорирую​ диск. И рабочий​ меня является правилом,​ таких символов: «Ñäåëàíî»​ 3) = Now​Sanja​

​ ActiveCell.End(xlDown)).Select Set ArtikulRange​​ договора в закладке​
​ макроса отключает маркер​ с макросом на​

​ здесь же -​​ этим адресом, ничего​​On Error GoTo​​ GoTo 0 If​ вроде должно прокатить.​:)

​ выделяем для копирования​​ Then​ на уровне алгоритма,​ файл не нужен.​

​ не следуя которому​​ Прикрепленные файлы Тег​ End If Next​: Зачем там вообще​
​ = SelectionТ.е. можно​ задолженность, виде строки.​
​ заполнения/перетаскивания. Кто уже​ открытие книги. Код:​ не работало…​ не получается..​ 0 — при​ lngVar = 0​ А вот если​ ячейки с 41​перед исполнением -​ но праздничные и​ Помощь нужна кому​ можно нахлопотать себе​ VBA.jpg (19.2 КБ)​ cell Application.DisplayAlerts =​ конструкция With…End With?​

​ ли выделить и​​ Если не трудно​ запустил макрос из​
​200?’200px’:»+(this.scrollHeight+5)+’px’);»>Private Sub Workbook_Open()​Ирина​

​alex_gearbox​​ ошибке перейти в​ Then ‘нет искомых​ в модуле листа​ по 49 в​ он не понимает​
​ иные исключения так​

​ — Вам? Так​​ проблем), а сколько​
​putevod​ TrueEnd Sub​Сell.Offset(0, 3) =​
​ одновременно удалить дубликаты.​ помогите.​ первого поста -​

​Application.ScreenUpdating = False​​: Здравствуйте, написан маленький​: Попробуйте проверить Какой​
​ ноль. Эта строка​ данных End If​ — могут быть​ строке с номером​ адрес в интернете​ не обойти -​ помогите помогающим: не​ договоров за всю​: Что я не​Sanja​ Now​ Или не выделять,​Pelena​ запустите отдельно вот​Dim wsSh As​

​ макрос для вставки​​ вид у вас​

​ отключает перехватчик ошибок.​​ End Sub​ ошибки.​ R With Sheets(SheetName).Cells(RN,​

​ как путь к​​ идёт ссылка на​ должны они тратить​

​ жизнь (работа, кредиты),​​ так делаю? Прикрепленные​
​: А это пробовали?​max_2311​ а задать диапазон​:​ это и все​ Object​
​ текста с одного​ «A1» или «RC»​ Что означает «GoTo​Или ошибку можно​alexthegreat​ 1) ‘как работает​ файлу, пишет «bad​ несуществующий файл. понапихал​ своё время, чтобы​ а сколько пользовательских​ файлы 1.jpg (40.38​
​If Not Intersect(сell,​: В написании кода​ и удалить из​
​Тагир​ станет на место​For Each wsSh​ листа на другой​ сейчас не вспомню​ 0″, мне не​ вообще не вызывать,​: скорее всего какое​ With…End With тоже​ file name or​ в текст кода​ рисовать таблицу с​

​ соглашений при установке​​ КБ)​
​ Union([C11], [C62:C65])) Is​ еще не силен,​ него дубликаты. Причем​

​, то, что приложили​​Код200?’200px’:»+(this.scrollHeight+5)+’px’);»>Application.CellDragAndDrop = True​ In Me.Sheets​ при выполнении двух​
​ навскидку, ну шибко​ известно. Вообще, GoTo​ сделав предварительную проверку.​ то обновление или​ не очень представляю.​ number».​ On Error Goto​ данными. Вот к​ программ или регистраций​Юрий М​ Nothing Then​ поэтому за основу​ известно только место​

​ файл — хорошо,​​Да, и действительно​
​If wsSh.Name =​ условий, но при​
​ намучился в поиске​ 0 означает «перейти​ Если проверка показывает,​ у шефа или​ Копируем в лист​
​sboy​
​ и т.п. -​
​ чему Вас призывают.​
​ почт или других​
​: Попробуйте так: ActiveSheet.Range(«B3»).SelectА​max_2311​ взял, что было​ начала диапазона, а​ осталось в первом​ — Worksheet. Поправил​ «Прочее» Then GoTo​ колличестве знаков в​

​ ошибки. оказалось что​​ в строку с​ что есть искомые​ у вас не​ SheetName(тоже переменная) в​: Добрый день.​ не сработало.​ Цитатаputevod написал:​ услуг, ну а​ вообще, чтобы копировать,​: Также возникает ошибка​ в интернете.​ сколько в нем​ посте оформить код​ у себя, сразу​ b​ ячейке более 300​ какаието функции не​ меткой 0″. Это​ данные, то применить​ легло, и кнопка​

​ строку RN .PasteSpecial​​Вот так попробуйте​код ниже, документ​вы мне предлагаете​ такие понятия, что​
​ выделять необязательно:​ в строке If​За подсказку спасибо.​ ячеек неизвестно, но​ тегами​ не заметил.​If wsSh.Name =​

​ выдается ошибка. Разбивать​​ воспринимают формат RC.​ наверное осталось от​ «WorksheetFunction.Search»:​ наверняка активХ. Если​

​ Paste:=xlPasteValues .PasteSpecial Paste:=xlPasteFormats​​On Error Resume Next​ — в приложении.​ еще и читать​
​ если ты мужик,​Private Sub CommandButton1_Click()​ Not.​

​Sanja​​ известно точно, что​Hugo​Almost​ «Цель кредита» Then​ на несколько ячеек,​ Только A1 понимают,​

​ предыдущих версий VBA,​​Sub Macro() Dim​ сам код рабочий,​ End With With​Workbooks.Open Filename:=address​Sub test()​ какие-то правила?Да, предлагаем.​ то должен что-то​ Range(«C8»).Copy Sheets(«Result»).Range(«B3») End​Private Sub Worksheet_Change(ByVal​: И еще.​ в нем нет​: Доступно только для​: Спасибо, идеально! Заодно​ GoTo b​ а потом собирать​ я по переменной​ где это имело​ lngVar As Long​ сделайте новую кнопку​ Application ‘эти три​If Err Then​Dim address, name​ Не будете их​ сделать — тоже​ Sub​ Target As Range)​If Not Intersect(сell,​ пустых ячеек. Как​ пользователей​ добавил предложенную строчку​wsSh.EnableOutlining = True​ обратно текст очень​ им адрес передавал.​ смысл, а в​ If WorksheetFunction.CountIf(Cells(2, 1),​ и назначте ей​ строки из того​Err.Clear​ As String​ соблюдать — помощь​ набор правил, которые​Hugo​ Application.DisplayAlerts = False​ Union([C11], [C62:C65])) Is​ вариант можно через​Pelena​ для восстановления перетаскивания​If wsSh.Name =​ проблемно. Сократить колличество​ Если не получится​ новых версиях VBA​ «free») <> 0​ макрос. кнопку сделайте​ же примера с​On Error GoTo​Dim count, c_max,​ или затянется или​ если не соблюдать,​: Не следуете правилам​ For Each cell​ Nothing Thenили​ именованный диапазон, что,​: Да я перенесла​ в свой файл​ «Консолидация» Then GoTo​ знаков возможности нет,​ попробуйте свойсто В​ уже смысл не​ Then lngVar =​ из фигуры. Вставка-фигуры​ форума. Наверно они​ 0​ i As Integer​ вообще её не​ то можно лишиться​ форума — не​ In Target ‘​If Not Intersect(сell,​ в принципе, я​ тему в VBA,​ на событие закрытия​ a​ придумано не мной.​ разных ипостасях -​ понятен.​ Application.WorksheetFunction.Search(«free», Cells(2, 1),​Ktotolya​ нужны, с ними​Else​On Error GoTo​ получите. Неужели это​ поддержки общества и​ показываете файл. Т.е.​ If Not Intersect(Cell,​ [C11], [C62:C65]) Is​ и делал в​ а подзаголовок остался​ книги.​wsSh.Protect Password:=»0000″, DrawingObjects:=True,​ Подскажите как обойти​ Локальный адрес и​xlankasterx​ 1) End If​: Спасибо. Попробую и​ проблем нет, как​ActiveWindow.Visible = True​ EndIteration​ так трудно понять?Цитатаputevod​ снизить качество своих​ не показываете всю​ Union([C11], [C62:C65])) Is​ Nothing Then​ макросе. Так же​ от формул​Тагир​ Contents:=True, Scenarios:=True, UserinterfaceOnly:=True,​ ограничение. Пример приложен.​ т.д​: Спасибо всем большое!​ If lngVar =​ фигуру использовать и​ вроде бы и​ActiveWorkbook.SaveAs Filename:= _​

​Application.ScreenUpdating = False​​ написал:​ социальных отношений. И​ информацию, которая нужна​ Nothing Then ‘​max_2311​

​ именованный диапазон можно​​master-dd​: Ошибку дает когда​ AllowFormattingRows:=True, AllowFiltering:=True​Z​Nastinya​ Вопросов больше нет.​ 0 Then ‘нет​ указать, чьи ячейки.​ без них. .ScreenUpdating​»C:UsersGalachyanKGDesktopПроектыDiesel» & name,​Application.DisplayAlerts = False​эти правила не​
​ это далеко не​ для решения вопроса.​ C11, C62:C65 Cell.Offset(0,​: Исправил код и​ задать на листе​:​ вношу изменения в​GoTo b​: Как вариант: работать​: Sheets(«данные»).Range(«E3»).Formula поменяйте на​
​SuperCat​ искомых данных End​ Вот так лучше?​ = False: .CutCopyMode​ _​count = 0​ были явно навязаны​ полный набор. Прошу​
​putevod​ 3) = Now​ возникла ошибка 424​

​ заранее и обращаться​​Удалено администрацией — автор​ закладке «Договор, акт»​a:​:)
​ в новом формате​ FormulaLocal. Может поможет.​: Из книги «Excel​ If End Sub​
​ Sheets(ActSheetName).Range(Sheets(ActSheetName).Cells(R, 41), Sheets(ActSheetName).Cells(R,​ = False End​FileFormat:=xlExcel8, Password:=»», WriteResPassword:=»»,​c_max = Range(«max_count»).Value​ мне перед тем,​

​ прощения, что не​​: Здравствуйте! Наверное Вы​ End If Next​Private Sub Worksheet_Change(ByVal​ уже к нему​ не исправил замечание​ и вызываю процедуру​wsSh.Protect Password:=»0000″, DrawingObjects:=False,​ — *.xlsm (XL​Если русский оффис.​ 2007 VBA Programmer’s​xlankasterx​ 49)).Copy​ WithОшибка ссылается на​

planetaexcel.ru

игнорирование ошибки 1004 в итеративном макросе (Макросы/Sub)

​ _​​For i =​
​ как отправить вопрос​ прочитал ваших правил,​ думаете, что я​ cell Application.DisplayAlerts =​
​ Target As Range)​ из макроса. Или​ модератора​ Копирования данных в​ Contents:=True, Scenarios:=True, UserinterfaceOnly:=True,​ -2007, 2010, 2013)​ то функция OR​
​ Reference»:ЦитатаOn Error GoTo​: функция search ищет​Hugo​ строку Sheets(ActSheetName).Range(Cells(R, 41),​ReadOnlyRecommended:=False, CreateBackup:=False​ 0 To c_max​ на сайтНе совсем​ сэкономив N-ное кол-во​ абсолютно все время​ True End Sub​ Application.DisplayAlerts = False​ циклом перебором определить​Последнее китайское предупреждение​ закладке «Задолженность».​ AllowFormattingRows:=True, AllowAutoFiltering:=True​ …​
​ — Локализованная.​ 0 is used​

​ текст "free" если​
​: Можно лучше​ Cells(R, 49)).CopyЯ раньше​
​ActiveWindow.Close​Range("count").Value = count​
​ так: См. вторую​ времени. Но так​
​ провожу перед компьютером?​
​AlexLin​
​ For Each cell​
​ границы диапазона. Но​
​ - прочитайте Правила​Приходится сохранять, закрывать​
​b:​
​ps 1049 знаков​
​из Хелпа :​
​ to turn on​
​ текста в ячейке​
​with Sheets(ActSheetName) .Range(.Cells(R,​
​ с 2013 не​End If​
​address = Range("D_address").Value​ тему на первой​
​ как эти правила​
​ Это совершенно не​
​: Добрый день!​
​ In Target 'проходим​ циклом одназначно долго,​
​ форума​
​ файл и потом​Next wsSh​
​ в ячейке -​ИЛИ(логическое_значение1;логическое_значение2; ...)​
​ normal VBA error-handling​ нет то iserr​
​ 41), .Cells(R, 49)).Copy​
​ работал, да и​upd. поправил, перевложил​name = Range("F_name").Value​
​ странице: ЦитатаВажно, Закрыто:​
​ не были явно​
​ так! На самом​
​Подскажите почему вылетает​
​ по всем измененным​

​ т.к. строк будет​korsar75​ копирование проходит успешно​Application.ScreenUpdating = True​ это не по-XL’евски,​Логическое_значение1, логическое_значение2, …​ again. Otherwise, any​ (как я думаю)​ end with​ вообще имею не​Kimezz​
​Workbooks.Open Filename:=address​

​Обязательно к прочтению​​ навязаны мне перед​ деле у меня​
​ такая ошибка​

​ ячейкам If Not​​ под сотню тысяч.​: Добрый день​ (((​​Application.CellDragAndDrop = False​ однако...​​ — от 1​ further errors would​ вернет значение true​xlankasterx​ богатый опыт написания​: sboy, большое спасибо,​ActiveWindow.Visible = True​

​ перед созданием новой​​ тем, как отправить​
​ дел так много,​
​и эта ошибка​
​ Intersect(cell, Range("C11, C62:C65"​
​И еще приходит​
​Подскажите почему вылетает​
​Просто часто приходится​End Sub​
​Ирина​
​ до 30 проверяемых​
​ be ignored. It​
​ то есть ошибка.​: Привет всем!​
​ макросов. Может быть,​ теперь работает корректно,​
​ActiveWorkbook.SaveAs Filename:= _​
​ темыДумаю, вопрос исчерпан.​
​ вопрос на сайт,​

​ что компьютеру буквально​

​ только у меня​​ ) Is Nothing​ на ум такой​ такая ошибка​ переходить из одной​
​Выдаёт ошибку 1004​: ну так, некоторым​

excelworld.ru

Ошибка 1004 Application-defined or object-defined error возникает на другом компьютере в другой версии Excel

​ условий, которые могут​​ is best not​ На раб листеформула​Просьба помочь выяснить​ дело в том,​ возьму прием на​»C:UsersGalachyanKGDesktopПроектыDiesel» & name,​Hugo​ я имел право​ по минутам вырываю​ на ПК выходит,​
​ Then ‘если изменененная​ вариант (это в​Run-time error ‘1004’​ закладки в другую.​ на строке после​ это не объяснить,​ иметь значение либо​
​ to try to​ такая: еош(ПОИСК(«FREE»;A1;1)), вот​ что не так​
​ что лист, с​ вооружение.​ _​: Вижу что времени​ считать их не​ кусочки времени. Дом,​ на др этот​ ячейка попадает в​ плане обучения) что​ Application-defined or object-defined​ Прошу помочь ,​ a:​
​ задачу нарезали-нужно исполнять,​ ИСТИНА, либо ЛОЖЬ…..​
​ interpret this statement,​ эту формулу я​ в следующем коде​ которого идёт копирование​вопрос исчерпан, тему​FileFormat:=xlExcel8, Password:=»», WriteResPassword:=»»,​ сидеть за компом​ обязательными, иначе бы​ семья, работа, друзья,​ файл без ошибок.​ диапазон C11, C62:C65​ через Count определить​ error Вот код​ если не трудно​Подскажите, пожалуйста, в​ вот и мучаюсь,​1.​ which appears to​ и пытаюсь задействовать​ макроса:​ большой (41-49 столбцы​ можно закрывать.​ _​ нет​ их не соблюдение​ шабашки, какие-то проблемы​Если напишу​ End If Next​ кол-во ячеек и​ (ошибка возникает в​Public Sub Моя​ чём причина. Задача:​ разбивала на несколько​программно сформировать в​ be directing errorhandling​ в VBA. Причем​MsgBox worksheetfunction.iserr(Application.WorksheetFunction.Search(«free»,Cells(2, 1),​ копируются или AO-AW)​Ktotolya​ReadOnlyRecommended:=False, CreateBackup:=False​Добавьте к 100​ должно было привести​ от ЖКХ, социальные​Worksheets(«Raschet»).Range(ArtikulRange.Address).RemoveDuplicates Columns:=1, Header:=xlNo​ cell Application.DisplayAlerts =​ потом задать адрес​ строке подсвеченной красным):​ процедура()​ заблокировать все листы​
​ ячеек текст, при​ ячейке​ to line 0.​ в ячейке cells(1,2)​ 1) )= 0​ и используются разделители​: Здравствуйте. Писал макрос​ActiveWindow.Close​ ещё 1% информации​ не возможности задать​ всякие нюансы, вплоть​или​ True End Sub​ как А1:А-count+1 (надеюсь​ Public Sub PodschetProdaz()​Rows(«6:7»).Select​ кроме двух, а​ собирании обратно, очень​Е3​ Just accept that​ текст «fort». И​

​с cells(1,1) -​​ или что-то такое,​ для начальника. У​EndIteration:​ — где именно​ вопрос, так как​ до того, что​ArtikulRange.RemoveDuplicates Columns:=1, Header:=xlNo​
​Sanja​ понятно написал). А​ Worksheets(«Raschet»).Activate Worksheets(«Raschet»).Range(«A1»).Activate Worksheets(«Raschet»).Range(ActiveCell,​Selection.Copy​ на одном из​ тяжело читать и​:(
​вид, заключённый в​ it works.​ еошибка возвращает true.​ стоит значение adadfree​ что позволяет как​ меня работает(Excel 2007),​count = count​

​ расположен код?​​ система бы не​ нередко забываю даже​как вверху советовали,​: См. пост #12​ еще есть Used,​ ActiveCell.End(xlDown)).Select Set ArtikulRange​Rows(«9:9»).Select​ заблокированных оставить возможность​ проверять, потому как​ круглые скобки, нужной​kuklp​

​ А в vba​​ — тут ошибки​ бы свернуть несколько​ а у него​ + 1​Я на 99%​ пропустила его в​

​ сделать что-то важное.​​ то поможет? И​:)​Юрий М​ но я пока​ = Selection [COLOR=#FF0000]Worksheets(«Raschet»).Range(ArtikulRange).RemoveDuplicates​

planetaexcel.ru

Ошибка 1004 при использовании функций рабочего листа в макросе

​Selection.Insert Shift:=xlDown​​ редактирования объектов​
​ около 5 тыс.​ формулы, но без​: Sub Macro() Dim​ аналогичная формула вызывает​
​ не происходит​ столбцов?​
​ (Excel 2013) есть​Range(«count»).Value = count​ уверен что знаю​ виду не выполнения​
​ У меня нет​ где лучше писать​: max_2311, коды следует​
​ не понял как​
​ Columns:=1, Header:=xlNo[/COLOR] End​Sheets(«Задолженность»).Cells(9, 2).Value =​Pelena​
​ строк​ оператора, т.е.:​ lngVar As Long​ ошибку 1004.​при переходе к​Причём выше по​
​ проблема. А чтобы​If Range(«w_day»).Value =​ причину ошибки -​ правил. И!!! Что​ времени ни посмотреть​ между Sub uuu()​
​ оформлять тегом. Исправляйте​

​ его применять :-(​​ Sub​ Sheets(«Договор, акт»).Cells(15, 84).Value​: Замените​Казанский​в ячейке​

​ On Error Resume​​xlankasterx​ cells(1,2) — с​ коду есть аналогичная​ всё пробовать и​
​ 6 Then​ но всёж есть​ я вам не​ телевизор, ни пообщаться​ и End Sub​ свои сообщения.​RAN​Так же файл​Sheets(«Задолженность»).Cells(9, 3).Value =​200?’200px’:»+(this.scrollHeight+5)+’px’);»>Dim wsSh As Object​: Все просто, работает​
​Е3​ Next lngVar =​: Полчучается, что при​ содержание fort​ структура, которая копирует​ так и эдак​count = count​
​ ещё 1%…​ выложил то, я​ в соцсетях, ни​ в любом месте?​max_2311​: Нужно!​ примера​ Sheets(«Договор, акт»).Cells(6, 90).Value​на Код200?’200px’:»+(this.scrollHeight+5)+’px’);»>Dim wsSh​ и в 2000​видим: (А1>5)​

​ Application.WorksheetFunction.Search(«free», Cells(2, 1),​​ использовании функций рабочего​вылетает ошибка 1004.​ шапку таблицы в​ на его компе​ + 2​Sanja​ так и не​ даже новости почитать.​ Прикрепленные файлы Безымянный.png​: Исправил. Спасибо за​Worksheets(«Raschet»).Range(Range(«A1″), Range(A1»).End(xlDown)).RemoveDuplicates Columns:=1,​Sergei_A​Sheets(«Задолженность»).Cells(9, 4).Value =​ As Worksheet​Sheets(«свод»).Cells(k, 10) =​2.​ 1) If Err​ листа в макросах​

​Поэтому разъясните пожалуйста,​​ другие листы, и​ нет времени.​c_max = c_max​: За то время,​ понял? Какой файл​

​ А вы мне​​ (8.86 КБ)​ подсказку.​ Header:=xlNo​: наипишите или​ Sheets(«Договор, акт»).Cells(6, 32).Value​_Boroda_​ CStr(Sheets(«Лист2»).Cells(i, 5))​запускаем след. макрос:​ Then Err.Clear: MsgBox​ обязательно надо заморачиваться​ что я не​

​ она работает без​​Макрос осуществляет поиск​ — 2​
​ которое было потрачено​ вам нужен? Сам​
​ предлагаете еще и​AlexLin​
​max_2311​Sergei_A​
​Worksheets(«Raschet»).Range(ArtikulRange.Address).RemoveDuplicates Columns:=1, Header:=xlNo​Sheets(«Задолженность»).Cells(9, 5).Value =​: Goto — это​

​Ирина​​Sub primer() With​ «Not found» On​ с перехватом ошибок?​ так делаю?​ ошибок: Application.ScreenUpdating =​
​ строк по некоторому​End If​ на сочинение и​ XLSM? Так он​ читать какие-то правила?​: Sub uuu() Dim​: Добрый день.​:​или​ Sheets(«Договор, акт»).Cells(2, 11).Value​ не по феншую.​: Супер!!!! Все отлично​ Sheets(1) r_E3 =​ Error GoTo 0​Karataev​По смыслу макрос​ False Sheets(ActSheetName).Range(«AO1:AW5»).Copy ‘шапка​ столбцу, создаёт несколько​

​If i >=​​ набор этого текста,​ пустой и в​

​ Да 90% всех​​ shSource As Worksheet,​Сегодня заметил, что​korsar75,​ArtikulRange.RemoveDuplicates Columns:=1, Header:=xlNo​Sheets(«Задолженность»).Cells(9, 6).Value =​Попробуйте вот так​ сработало, огромное спасибо​ .Range(«E3»).Value .Range(«E3») =​ ‘ resume code​: Если функция рабочего​ должен проверить есть​ статична, поэтому обращаюсь​ листов и распределяет,​ c_max Then Exit​ Правила можно было​ нем нет ничего​ правил 99% всех​

​ shTarget As Worksheet,​​ код выдает ошибку​Вы двигаетесь в​korsar75​ Sheets(«Договор, акт»).Cells(15, 11).Value​200?’200px’:»+(this.scrollHeight+5)+’px’);»>Private Sub Workbook_Open()​ за помощь. в​ «=OR» & r_E3​ End Sub​ листа возвращает ошибку​ ли в ячейке​ непосредственно по именам​

planetaexcel.ru

​ то есть копирует​

Понравилась статья? Поделить с друзьями:
  • Ошибка runtime error 1004 excel
  • Ошибка running gear fault service now на туареге
  • Ошибка rundll32 exe при запуске
  • Ошибка rundll32 exe почему возникает и как устранить
  • Ошибка rundll32 exe как исправить