Проблема
При попытке использовать Microsoft Visual Basic for Applications (VBA) для изменения свойств документа появляется одно из приведенных ниже сообщений об ошибке.
Ошибка при выполнении ‘4248’:
Команда недоступна, так как нет открытых документов
Ошибка при выполнении ‘4605’:
Метод или свойство недоступны, поскольку окно документа не активно
или
Ошибка при выполнении ‘5941’:
Запрашиваемый номер семейства не существует
Причина
Проблема возникает, когда нет открытых документов или не открыт документ, на который сделана ссылка. В программе Word предусмотрено изменение свойств только открытых документов.
Примечание. Такие сообщения об ошибках могут появиться также в том случае, если открыт документ, у которого свойство Видимый имеет значение Ложь.
Временное решение
Корпорация Microsoft предлагает примеры программного кода только для иллюстрации и не предоставляет явных или подразумеваемых гарантий относительно их корректной работы в конкретных случаях и в пользовательских приложениях. Примеры в данной статье рассчитаны на пользователя, имеющего достаточный уровень знаний соответствующего языка программирования, а также необходимых средств разработки и отладки. Специалисты служб технической поддержки Microsoft могут пояснить назначение тех или иных конструкций кода в конкретном примере, но модификация примеров и их адаптация к задачам разработчика не поддерживается. Если вам требуется дополнительная консультация по вопросам программирования, вы можете обратиться в службу консалтинга Microsoft или связаться с сертифицированными партнерами компании Microsoft. Дополнительную информацию о партнерах корпорации Microsoft можно найти в Интернете по следующему адресу:
http://www.microsoft.com/partner/referral/ За дополнительной информацией обратитесь к веб-узле корпорации Microsoft по адресу:
http://support.microsoft.com/default.aspx?scid=fh;RU;CNTACTMSЗа дополнительной информацией об использовании приведенных в этой статье примеров обратитесь к следующей статье Microsoft Knowledge Base:
290140 How to Run Sample Code from Knowledge Ниже приведен пример макроса на языке Visual Basic for Applications для изменения значения поля Заголовок в диалоговом окне Свойства. Пример содержит специальный программный код для перехвата ошибок на случай, если нет открытых документов, и вывода соответствующего сообщения.
Sub ChangeDocProperties()On Error GoTo ErrHandler
ActiveDocument.BuiltInDocumentProperties("Title") = "My Title"
Exit SubErrHandler:
If Err <> 0 Then
'
' Display an error message.
'
MsgBox Err.Description
'
' Clear the error.
'
Err.Clear
Resume NextEnd If
End Sub
Приведенный ниже программный код предусмотрен для выполнения следующих целей.
-
Перехват ошибок, если нет открытых документов
и
-
Создание нового документа при перехвате ошибки
и
-
Возобновление нормальной работы в строке, вызвавшей появление ошибки
Sub ChangeDocProperties()On Error GoTo ErrHandler
ActiveDocument.BuiltInDocumentProperties("Title") = "My Title"
Exit SubErrHandler:
If Err <> 0 Then
'
' Add a document.
'
Documents.Add
'
' Clear the error.
'
Err.Clear
'
' Run the code that caused the error.
'
ResumeEnd If
End Sub
Ссылки
Для получения помощи по работе с Visual Basic обратитесь к следующей статье Microsoft Knowledge Base:
305326 Programming Resources for Visual Basic for Applications
Нужна дополнительная помощь?
SkyFlyStaR 1 / 1 / 0 Регистрация: 16.10.2011 Сообщений: 69 |
||||
1 |
||||
10.04.2013, 19:12. Показов 5711. Ответов 7 Метки нет (Все метки)
oTable — таблица Добавлено через 22 минуты
__________________
0 |
Казанский 15131 / 6405 / 1730 Регистрация: 24.09.2011 Сообщений: 9,999 |
||||
10.04.2013, 20:34 |
2 |
|||
А можно выполнить действия
Выделение при этом видно?
0 |
1 / 1 / 0 Регистрация: 16.10.2011 Сообщений: 69 |
|
10.04.2013, 20:53 [ТС] |
3 |
На otable.rows(2).select так реагирует: Отсутствует доступ к отдельным строкам, поскольку таблица имеет ячейки, объединенные по вертикали Это можно как-то обойти? Или при таком редактировании чтение из ячеек таблицы невозможно?
0 |
15131 / 6405 / 1730 Регистрация: 24.09.2011 Сообщений: 9,999 |
|
10.04.2013, 22:00 |
4 |
Форматирование таблиц в WORD
1 |
5468 / 1148 / 50 Регистрация: 15.09.2012 Сообщений: 3,514 |
|
11.04.2013, 07:35 |
5 |
SkyFlyStaR, напишите словесное описание вашей задачи. Если у вас задача большая, то разбейте задачу на части и обсудите пока одну часть. Если на словах сложно объяснить, то сформируйте Word-документ с примерными данными, выложите на Форуме этот документ и на основе этого документа опишите вашу задачу.
0 |
1 / 1 / 0 Регистрация: 16.10.2011 Сообщений: 69 |
|
11.04.2013, 19:15 [ТС] |
6 |
SkyFlyStaR, напишите словесное описание вашей задачи. Если у вас задача большая, то разбейте задачу на части и обсудите пока одну часть. Если на словах сложно объяснить, то сформируйте Word-документ с примерными данными, выложите на Форуме этот документ и на основе этого документа опишите вашу задачу. Нужно считать текст из каждой ячейки 1го столбца таблицы , все просто, но эта ошибка все портит
0 |
Скрипт 5468 / 1148 / 50 Регистрация: 15.09.2012 Сообщений: 3,514 |
||||||||||
11.04.2013, 19:47 |
7 |
|||||||||
Вариант 1 Код работает с первой таблицей на активном документе. Кликните здесь для просмотра всего текста
Вариант 2 Другой вариант. Отличие от первого варианта в том, что макрос должен быстрее работать, т.к. не надо будет проходить по всем ячейкам таблицы. Кликните здесь для просмотра всего текста
Хотя в таком документе (см. вложение) второй вариант неправильно работает. Вложения
2 |
Скрипт 5468 / 1148 / 50 Регистрация: 15.09.2012 Сообщений: 3,514 |
||||
11.04.2013, 20:39 |
8 |
|||
Вариант 3 Отличие от других двух вариантов. Работает в тех случаях, когда «Вариант 2» не работает. По идее быстрее должен работать, чем «Вариант 1», т.к. не просматриваются все ячейки. Кликните здесь для просмотра всего текста
1 |
Содержание
- При попытке использовать VBA для изменения свойств документа появляется сообщение об ошибке при выполнении 4248, 4605 или 5941
- Проблема
- Причина
- Временное решение
- Ссылки
- You receive run-time error 4248, 4605 or 5941 when you try to change properties on an unopened document in Word
- Symptoms
- Cause
- Workaround
- References
- You receive run-time error 4248, 4605 or 5941 when you try to change properties on an unopened document in Word
- Symptoms
- Cause
- Workaround
- References
- You receive run-time error 4248, 4605 or 5941 when you try to change properties on an unopened document in Word
- Symptoms
- Cause
- Workaround
- References
- Как исправить ошибку Microsoft Word 5941
- Сводка «Microsoft Word Error 5941
- Что вызывает ошибку 5941 во время выполнения?
- Распространенные сообщения об ошибках в Microsoft Word Error 5941
- Microsoft Word Error 5941 Истоки проблем
При попытке использовать VBA для изменения свойств документа появляется сообщение об ошибке при выполнении 4248, 4605 или 5941
Проблема
При попытке использовать Microsoft Visual Basic for Applications (VBA) для изменения свойств документа появляется одно из приведенных ниже сообщений об ошибке.
Ошибка при выполнении ‘4248’:
Команда недоступна, так как нет открытых документов
Ошибка при выполнении ‘4605’:
Метод или свойство недоступны, поскольку окно документа не активно
Ошибка при выполнении ‘5941’:
Запрашиваемый номер семейства не существует
Причина
Проблема возникает, когда нет открытых документов или не открыт документ, на который сделана ссылка. В программе Word предусмотрено изменение свойств только открытых документов.
Примечание. Такие сообщения об ошибках могут появиться также в том случае, если открыт документ, у которого свойство Видимый имеет значение Ложь.
Временное решение
Корпорация Microsoft предлагает примеры программного кода только для иллюстрации и не предоставляет явных или подразумеваемых гарантий относительно их корректной работы в конкретных случаях и в пользовательских приложениях. Примеры в данной статье рассчитаны на пользователя, имеющего достаточный уровень знаний соответствующего языка программирования, а также необходимых средств разработки и отладки. Специалисты служб технической поддержки Microsoft могут пояснить назначение тех или иных конструкций кода в конкретном примере, но модификация примеров и их адаптация к задачам разработчика не поддерживается. Если вам требуется дополнительная консультация по вопросам программирования, вы можете обратиться в службу консалтинга Microsoft или связаться с сертифицированными партнерами компании Microsoft. Дополнительную информацию о партнерах корпорации Microsoft можно найти в Интернете по следующему адресу:
http://www.microsoft.com/partner/referral/ За дополнительной информацией обратитесь к веб-узле корпорации Microsoft по адресу:
http://support.microsoft.com/default.aspx?scid=fh;RU;CNTACTMSЗа дополнительной информацией об использовании приведенных в этой статье примеров обратитесь к следующей статье Microsoft Knowledge Base:
290140 How to Run Sample Code from Knowledge Ниже приведен пример макроса на языке Visual Basic for Applications для изменения значения поля Заголовок в диалоговом окне Свойства. Пример содержит специальный программный код для перехвата ошибок на случай, если нет открытых документов, и вывода соответствующего сообщения.
Приведенный ниже программный код предусмотрен для выполнения следующих целей.
Перехват ошибок, если нет открытых документов
Создание нового документа при перехвате ошибки
Возобновление нормальной работы в строке, вызвавшей появление ошибки
Ссылки
Для получения помощи по работе с Visual Basic обратитесь к следующей статье Microsoft Knowledge Base:
305326 Programming Resources for Visual Basic for Applications
Источник
You receive run-time error 4248, 4605 or 5941 when you try to change properties on an unopened document in Word
Symptoms
When you try to use Microsoft Visual Basic for Applications (VBA) to change the properties of a document, you may receive one of the following error messages:
Run-time error ‘4248’:
This command is not available because no document is open.
Run-time error ‘4605’:
This method or property is not available because a document window is not active.
Run-time error ‘5941’:
The requested member of the collection does not exist.
Cause
This problem may occur if you do not have a document open, or if the document that you are referencing is not open. Word can only change the properties of an open (or visible) document.
Note These error messages may also appear if you open the document with the Visible property set to
False.
Workaround
Microsoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support professionals can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific needs.
If you have limited programming experience, you may want to contact a Microsoft Certified Partner or Microsoft Advisory Services. For more information, visit these Microsoft Web sites:
For more information about the support options that are available and about how to contact Microsoft, visit the following Microsoft Web site:http://support.microsoft.com/default.aspx?scid=fh;EN-US;CNTACTMS
For additional information about how to use the sample code that is included in this article, click the following article number to view the article in the Microsoft Knowledge Base:
290140 OFFXP: How to Run Sample Code from Knowledge Base Articles
The following sample VBA macros demonstrate how to change the value of the Title field in the
Properties dialog box. The following sample also includes code to trap the error, in case there are no documents open, and to display a message:
The following sample macro includes code that will do the following:
Trap the error, in case there are no documents open.
In the error trap, create a new document.
Resume execution at the line that caused the error.
References
For additional information about how to get help with VBA, click the following article number to view the article in the Microsoft Knowledge Base:
305326 OFFXP: Programming Resources for Visual Basic for Applications
Источник
You receive run-time error 4248, 4605 or 5941 when you try to change properties on an unopened document in Word
Symptoms
When you try to use Microsoft Visual Basic for Applications (VBA) to change the properties of a document, you may receive one of the following error messages:
Run-time error ‘4248’:
This command is not available because no document is open.
Run-time error ‘4605’:
This method or property is not available because a document window is not active.
Run-time error ‘5941’:
The requested member of the collection does not exist.
Cause
This problem may occur if you do not have a document open, or if the document that you are referencing is not open. Word can only change the properties of an open (or visible) document.
Note These error messages may also appear if you open the document with the Visible property set to
False.
Workaround
Microsoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support professionals can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific needs.
If you have limited programming experience, you may want to contact a Microsoft Certified Partner or Microsoft Advisory Services. For more information, visit these Microsoft Web sites:
For more information about the support options that are available and about how to contact Microsoft, visit the following Microsoft Web site:http://support.microsoft.com/default.aspx?scid=fh;EN-US;CNTACTMS
For additional information about how to use the sample code that is included in this article, click the following article number to view the article in the Microsoft Knowledge Base:
290140 OFFXP: How to Run Sample Code from Knowledge Base Articles
The following sample VBA macros demonstrate how to change the value of the Title field in the
Properties dialog box. The following sample also includes code to trap the error, in case there are no documents open, and to display a message:
The following sample macro includes code that will do the following:
Trap the error, in case there are no documents open.
In the error trap, create a new document.
Resume execution at the line that caused the error.
References
For additional information about how to get help with VBA, click the following article number to view the article in the Microsoft Knowledge Base:
305326 OFFXP: Programming Resources for Visual Basic for Applications
Источник
You receive run-time error 4248, 4605 or 5941 when you try to change properties on an unopened document in Word
Symptoms
When you try to use Microsoft Visual Basic for Applications (VBA) to change the properties of a document, you may receive one of the following error messages:
Run-time error ‘4248’:
This command is not available because no document is open.
Run-time error ‘4605’:
This method or property is not available because a document window is not active.
Run-time error ‘5941’:
The requested member of the collection does not exist.
Cause
This problem may occur if you do not have a document open, or if the document that you are referencing is not open. Word can only change the properties of an open (or visible) document.
Note These error messages may also appear if you open the document with the Visible property set to
False.
Workaround
Microsoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support professionals can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific needs.
If you have limited programming experience, you may want to contact a Microsoft Certified Partner or Microsoft Advisory Services. For more information, visit these Microsoft Web sites:
For more information about the support options that are available and about how to contact Microsoft, visit the following Microsoft Web site:http://support.microsoft.com/default.aspx?scid=fh;EN-US;CNTACTMS
For additional information about how to use the sample code that is included in this article, click the following article number to view the article in the Microsoft Knowledge Base:
290140 OFFXP: How to Run Sample Code from Knowledge Base Articles
The following sample VBA macros demonstrate how to change the value of the Title field in the
Properties dialog box. The following sample also includes code to trap the error, in case there are no documents open, and to display a message:
The following sample macro includes code that will do the following:
Trap the error, in case there are no documents open.
In the error trap, create a new document.
Resume execution at the line that caused the error.
References
For additional information about how to get help with VBA, click the following article number to view the article in the Microsoft Knowledge Base:
305326 OFFXP: Programming Resources for Visual Basic for Applications
Источник
Как исправить ошибку Microsoft Word 5941
Номер ошибки: | Ошибка 5941 | |
Название ошибки: | Microsoft Word Error 5941 | |
Описание ошибки: | Ошибка 5941: Возникла ошибка в приложении Microsoft Word. Приложение будет закрыто. Приносим извинения за неудобства. | |
Разработчик: | Microsoft Corporation | |
Программное обеспечение: | Microsoft Word | |
Относится к: | Windows XP, Vista, 7, 8, 10, 11 |
Сводка «Microsoft Word Error 5941
Это наиболее распространенное условие «Microsoft Word Error 5941», известное как ошибка времени выполнения (ошибка). Программисты работают через различные уровни отладки, пытаясь убедиться, что Microsoft Word как можно ближе к безошибочным. Ошибки, такие как ошибка 5941, иногда удаляются из отчетов, оставляя проблему остается нерешенной в программном обеспечении.
В выпуске последней версии Microsoft Word может возникнуть ошибка, которая гласит: «Microsoft Word Error 5941». Сообщение об этой ошибке 5941 позволит разработчикам обновить свое приложение и исправить любые ошибки, которые могут вызвать его. Затем Microsoft Corporation будет иметь знания, чтобы исследовать, как и где устранить проблему. Таким образом, в этих случаях разработчик выпустит обновление программы Microsoft Word, чтобы исправить отображаемое сообщение об ошибке (и другие сообщенные проблемы).
Что вызывает ошибку 5941 во время выполнения?
Сбой устройства или Microsoft Word обычно может проявляться с «Microsoft Word Error 5941» в качестве проблемы во время выполнения. Причины сбоев обработки можно отличить, классифицируя ошибки 5941 следующим образом:.
Ошибка 5941 Crash — Ошибка 5941 является хорошо известной, которая происходит, когда неправильная строка кода компилируется в исходный код программы. Это возникает, когда Microsoft Word не реагирует на ввод должным образом или не знает, какой вывод требуется взамен.
Утечка памяти «Microsoft Word Error 5941» — при утечке памяти Microsoft Word это может привести к медленной работе устройства из-за нехватки системных ресурсов. Потенциальные триггеры могут быть бесконечным циклом, что приводит к тому, что работа программы запускается снова и снова.
Ошибка 5941 Logic Error — «логическая ошибка», как говорят, генерируется, когда программное обеспечение получает правильный ввод, но генерирует неверный вывод. Обычные причины этой проблемы связаны с ошибками в обработке данных.
Большинство ошибок Microsoft Word Error 5941 являются результатом отсутствия или повреждения версии файла, установленного Microsoft Word. Возникновение подобных проблем является раздражающим фактором, однако их легко устранить, заменив файл Microsoft Corporation, из-за которого возникает проблема. В некоторых случаях реестр Windows пытается загрузить файл Microsoft Word Error 5941, который больше не существует; в таких ситуациях рекомендуется запустить сканирование реестра, чтобы исправить любые недопустимые ссылки на пути к файлам.
Распространенные сообщения об ошибках в Microsoft Word Error 5941
Частичный список ошибок Microsoft Word Error 5941 Microsoft Word:
- «Ошибка в приложении: Microsoft Word Error 5941»
- «Microsoft Word Error 5941 не является приложением Win32.»
- «Microsoft Word Error 5941 должен быть закрыт. «
- «К сожалению, мы не можем найти Microsoft Word Error 5941. «
- «Microsoft Word Error 5941 не найден.»
- «Проблема при запуске приложения: Microsoft Word Error 5941. «
- «Файл Microsoft Word Error 5941 не запущен.»
- «Microsoft Word Error 5941 выйти. «
- «Ошибка пути программного обеспечения: Microsoft Word Error 5941. «
Проблемы Microsoft Word Microsoft Word Error 5941 возникают при установке, во время работы программного обеспечения, связанного с Microsoft Word Error 5941, во время завершения работы или запуска или менее вероятно во время обновления операционной системы. При появлении ошибки Microsoft Word Error 5941 запишите вхождения для устранения неполадок Microsoft Word и чтобы HelpMicrosoft Corporation найти причину.
Microsoft Word Error 5941 Истоки проблем
Проблемы Microsoft Word Error 5941 вызваны поврежденным или отсутствующим Microsoft Word Error 5941, недопустимыми ключами реестра, связанными с Microsoft Word, или вредоносным ПО.
В первую очередь, проблемы Microsoft Word Error 5941 создаются:
- Недопустимая или поврежденная запись Microsoft Word Error 5941.
- Файл Microsoft Word Error 5941 поврежден от вирусной инфекции.
- Microsoft Word Error 5941 злонамеренно или ошибочно удален другим программным обеспечением (кроме Microsoft Word).
- Microsoft Word Error 5941 конфликтует с другой программой (общим файлом).
- Поврежденная установка или загрузка Microsoft Word (Microsoft Word Error 5941).
Совместима с Windows 2000, XP, Vista, 7, 8, 10 и 11
Источник
ddmitriy Пользователь Сообщений: 5 |
#1 21.06.2017 17:17:09 Добрый день.
Ошибка указывает на строку.
Закладки проверил, всё в норме. Подскажите что ещё может быть не так. Спасибо. |
||||
The_Prist Пользователь Сообщений: 13997 Профессиональная разработка приложений для MS Office |
Ответ один — его действительно не существует. Если Вы в одну и ту же закладку в цикле что-то пытаетесь записать, то это вполне возможно, т.к. после первой записи закладка как правило удаляется. Даже самый простой вопрос можно превратить в огромную проблему. Достаточно не уметь формулировать вопросы… |
R Dmitry Пользователь Сообщений: 3103 Excel,MSSQL,Oracle,Qlik |
#3 21.06.2017 17:34:49 покажите весь код
|
|||
R Dmitry Пользователь Сообщений: 3103 Excel,MSSQL,Oracle,Qlik |
#4 21.06.2017 17:49:06
——
|
|||
The_Prist Пользователь Сообщений: 13997 Профессиональная разработка приложений для MS Office |
Дмитрий, в данном случае активация избыточна, т.к. идет обращение к закладкам конкретного документа: WD. Поэтому озвученная ошибка не может возникнуть по этой причине. Если бы активен был другой документ, то была бы другая ошибка. Изменено: The_Prist — 21.06.2017 17:50:14 Даже самый простой вопрос можно превратить в огромную проблему. Достаточно не уметь формулировать вопросы… |
R Dmitry Пользователь Сообщений: 3103 Excel,MSSQL,Oracle,Qlik |
#6 21.06.2017 17:51:01 The_Prist, Поэтому и прошу старттопика показать весь кусок кода. Что там у него за WD только он знает
|
|
ddmitriy Пользователь Сообщений: 5 |
#7 21.06.2017 17:54:07 R Dmitry? не помогло.
|
|
The_Prist Пользователь Сообщений: 13997 Профессиональная разработка приложений для MS Office |
#8 21.06.2017 17:54:37
если кусок — да, не удалится. Но у ТС-а же не так Даже самый простой вопрос можно превратить в огромную проблему. Достаточно не уметь формулировать вопросы… |
||
Номер ошибки: | Ошибка 5941 | |
Название ошибки: | Microsoft Word Error 5941 | |
Описание ошибки: | Ошибка 5941: Возникла ошибка в приложении Microsoft Word. Приложение будет закрыто. Приносим извинения за неудобства. | |
Разработчик: | Microsoft Corporation | |
Программное обеспечение: | Microsoft Word | |
Относится к: | Windows XP, Vista, 7, 8, 10, 11 |
Сводка «Microsoft Word Error 5941
Это наиболее распространенное условие «Microsoft Word Error 5941», известное как ошибка времени выполнения (ошибка). Программисты работают через различные уровни отладки, пытаясь убедиться, что Microsoft Word как можно ближе к безошибочным. Ошибки, такие как ошибка 5941, иногда удаляются из отчетов, оставляя проблему остается нерешенной в программном обеспечении.
В выпуске последней версии Microsoft Word может возникнуть ошибка, которая гласит: «Microsoft Word Error 5941». Сообщение об этой ошибке 5941 позволит разработчикам обновить свое приложение и исправить любые ошибки, которые могут вызвать его. Затем Microsoft Corporation будет иметь знания, чтобы исследовать, как и где устранить проблему. Таким образом, в этих случаях разработчик выпустит обновление программы Microsoft Word, чтобы исправить отображаемое сообщение об ошибке (и другие сообщенные проблемы).
Что вызывает ошибку 5941 во время выполнения?
Сбой устройства или Microsoft Word обычно может проявляться с «Microsoft Word Error 5941» в качестве проблемы во время выполнения. Причины сбоев обработки можно отличить, классифицируя ошибки 5941 следующим образом:.
Ошибка 5941 Crash — Ошибка 5941 является хорошо известной, которая происходит, когда неправильная строка кода компилируется в исходный код программы. Это возникает, когда Microsoft Word не реагирует на ввод должным образом или не знает, какой вывод требуется взамен.
Утечка памяти «Microsoft Word Error 5941» — при утечке памяти Microsoft Word это может привести к медленной работе устройства из-за нехватки системных ресурсов. Потенциальные триггеры могут быть бесконечным циклом, что приводит к тому, что работа программы запускается снова и снова.
Ошибка 5941 Logic Error — «логическая ошибка», как говорят, генерируется, когда программное обеспечение получает правильный ввод, но генерирует неверный вывод. Обычные причины этой проблемы связаны с ошибками в обработке данных.
Большинство ошибок Microsoft Word Error 5941 являются результатом отсутствия или повреждения версии файла, установленного Microsoft Word. Возникновение подобных проблем является раздражающим фактором, однако их легко устранить, заменив файл Microsoft Corporation, из-за которого возникает проблема. В некоторых случаях реестр Windows пытается загрузить файл Microsoft Word Error 5941, который больше не существует; в таких ситуациях рекомендуется запустить сканирование реестра, чтобы исправить любые недопустимые ссылки на пути к файлам.
Распространенные сообщения об ошибках в Microsoft Word Error 5941
Частичный список ошибок Microsoft Word Error 5941 Microsoft Word:
- «Ошибка в приложении: Microsoft Word Error 5941»
- «Microsoft Word Error 5941 не является приложением Win32.»
- «Microsoft Word Error 5941 должен быть закрыт. «
- «К сожалению, мы не можем найти Microsoft Word Error 5941. «
- «Microsoft Word Error 5941 не найден.»
- «Проблема при запуске приложения: Microsoft Word Error 5941. «
- «Файл Microsoft Word Error 5941 не запущен.»
- «Microsoft Word Error 5941 выйти. «
- «Ошибка пути программного обеспечения: Microsoft Word Error 5941. «
Проблемы Microsoft Word Microsoft Word Error 5941 возникают при установке, во время работы программного обеспечения, связанного с Microsoft Word Error 5941, во время завершения работы или запуска или менее вероятно во время обновления операционной системы. При появлении ошибки Microsoft Word Error 5941 запишите вхождения для устранения неполадок Microsoft Word и чтобы HelpMicrosoft Corporation найти причину.
Microsoft Word Error 5941 Истоки проблем
Проблемы Microsoft Word Error 5941 вызваны поврежденным или отсутствующим Microsoft Word Error 5941, недопустимыми ключами реестра, связанными с Microsoft Word, или вредоносным ПО.
В первую очередь, проблемы Microsoft Word Error 5941 создаются:
- Недопустимая или поврежденная запись Microsoft Word Error 5941.
- Файл Microsoft Word Error 5941 поврежден от вирусной инфекции.
- Microsoft Word Error 5941 злонамеренно или ошибочно удален другим программным обеспечением (кроме Microsoft Word).
- Microsoft Word Error 5941 конфликтует с другой программой (общим файлом).
- Поврежденная установка или загрузка Microsoft Word (Microsoft Word Error 5941).
Продукт Solvusoft
Загрузка
WinThruster 2022 — Проверьте свой компьютер на наличие ошибок.
Совместима с Windows 2000, XP, Vista, 7, 8, 10 и 11
Установить необязательные продукты — WinThruster (Solvusoft) | Лицензия | Политика защиты личных сведений | Условия | Удаление
- Remove From My Forums
-
Question
-
I have followed Greg’s instructions for check boxes on
http://gregmaxey.mvps.org/Add_Toggle_Objects.htm but when I double click on the box it gives me the run time error. I have saved as a template (.dotm) and then saved document as a .docm but always get the same error. Would love this to work as I can
not have both controls and legacy form controls in same document — good on you microsoft!Any help would be great.
Answers
-
I assume that when you get the error, one of the two macros named CheckIt or UncheckIt is highlighted in the VBA editor. The most likely reason for that error is that the template you’re working with does not contain an AutoText entry named «Checked
Box» or «Unchecked Box». (Unfortunately VBA’s error handler never specifies which collection it’s complaining about, but in this case the AutoTextEntries collection is the only one involved in the code.) Greg’s steps 3 and 4 are written for
Word 2003 or earlier, and they need some additional information for Word 2007 or 2010.In Word 2007 or 2010, AutoText has become part of the larger Building Blocks feature. You should have noticed that the dialog you get when you press F3 is different from the one shown on Greg’s page; now it’s a Create New Building Block dialog with more
boxes. To get an AutoText entry, you MUST change the Gallery box from «Quick Parts» to «AutoText». Also, to make the AttachedTemplate part of the code work, you MUST change the Save In box from Building Block.dotx to the name of the template
that contains the code.One other bit: Don’t save the code into a .docm document, because that will lose the AutoText entries (which can only be stored in templates, not in documents).
Woodabyna wrote:
I have followed Greg’s instructions for check boxes on
http://gregmaxey.mvps.org/Add_Toggle_Objects.htm but when I double
click on the box it gives me the run time error. I have saved as a
template (.dotm) and then saved document as a .docm but always get
the same error. Would love this to work as I can not have both
controls and legacy form controls in same document — good on you
microsoft!Any help would be great.
Jay Freedman MS Word MVP
-
Marked as answer by
Tuesday, July 13, 2010 2:18 AM
-
Marked as answer by
- Remove From My Forums
-
Question
-
I have followed Greg’s instructions for check boxes on
http://gregmaxey.mvps.org/Add_Toggle_Objects.htm but when I double click on the box it gives me the run time error. I have saved as a template (.dotm) and then saved document as a .docm but always get the same error. Would love this to work as I can
not have both controls and legacy form controls in same document — good on you microsoft!Any help would be great.
Answers
-
I assume that when you get the error, one of the two macros named CheckIt or UncheckIt is highlighted in the VBA editor. The most likely reason for that error is that the template you’re working with does not contain an AutoText entry named «Checked
Box» or «Unchecked Box». (Unfortunately VBA’s error handler never specifies which collection it’s complaining about, but in this case the AutoTextEntries collection is the only one involved in the code.) Greg’s steps 3 and 4 are written for
Word 2003 or earlier, and they need some additional information for Word 2007 or 2010.In Word 2007 or 2010, AutoText has become part of the larger Building Blocks feature. You should have noticed that the dialog you get when you press F3 is different from the one shown on Greg’s page; now it’s a Create New Building Block dialog with more
boxes. To get an AutoText entry, you MUST change the Gallery box from «Quick Parts» to «AutoText». Also, to make the AttachedTemplate part of the code work, you MUST change the Save In box from Building Block.dotx to the name of the template
that contains the code.One other bit: Don’t save the code into a .docm document, because that will lose the AutoText entries (which can only be stored in templates, not in documents).
Woodabyna wrote:
I have followed Greg’s instructions for check boxes on
http://gregmaxey.mvps.org/Add_Toggle_Objects.htm but when I double
click on the box it gives me the run time error. I have saved as a
template (.dotm) and then saved document as a .docm but always get
the same error. Would love this to work as I can not have both
controls and legacy form controls in same document — good on you
microsoft!Any help would be great.
Jay Freedman MS Word MVP
-
Marked as answer by
Tuesday, July 13, 2010 2:18 AM
-
Marked as answer by
- Remove From My Forums
-
Question
-
I have looked at some of the explanations and suggested cures but they are not simple enough for me. I am trying to make a macro which will insert my address etc on a blank document. I have the address layout stored in Quick Parts, so having
brought up a blank normal document on screen, I usually go to Quick Parts and insert the block and then back to Home before proceeding. I wanted to have a Quick Access macro which would do that. So I am bringing up the blank, going into record
Macro and assigning to button and recording then to Quick Parts, selecting the address, Insert, and then back to Home, before Stop Recording. However, when I try to run the macro, I get the 5941 message each and every time. On debug
the whole macro is highlighted.I did make a successful macro for PrintPage which was fine and I use it all the time. I have Windows 7 64 bit and Word 2010 Office and Student.
Answers
-
Sounds right. Like this?
Sub Macro1()
‘
‘ Macro1 Macro
‘
‘Templates.LoadBuildingBlocks
Application.Templates( _
«C:UsersJosephineAppDataRoamingMicrosoftDocument Building Blocks103314Building Blocks.dotx» _
).BuildingBlockEntries(«HomeAddress»).Insert Where:=Selection.Range, _
RichText:=True
End Sub
Enjoy,
Tony
www.WordArticles.com-
Marked as answer by
Monday, July 18, 2011 6:52 AM
-
Marked as answer by
-
Hi «Boots»
I was going to suggest the same thing as Tony and am as surprised as he that it didn’t work. The next step would be to narrow down whether the «missing member» of the collection refers to the template or to the Building Block entry. So let’s break the recorded
macro down into smaller pieces and see exactly where the problem is coming from. Try something like this and tell us which line gets highlighted:Sub Macro1() Dim tmpl as Word.Template Application.Templates.LoadBuildingBlocks Set tmpl = Application.Templates( _ "C:UsersJosephineAppDataRoamingMicrosoftDocument Building Blocks103314Building Blocks.dotx") tmpl.BuildingBlockEntries("HomeAddress").Insert Where:=Selection.Range, _ RichText:=True End Sub
Cindy Meister, VSTO/Word MVP
-
Marked as answer by
Calvin_Gao
Monday, July 18, 2011 6:51 AM
-
Marked as answer by
-
Hi «Boots»
I’m amazed that just pulling the stuff apart worked. Word never ceases to amaze me…
In order to give a macro a different name, simply change what appears after the word «Sub». To name the macro InsertMyAddress, for example, change the line
Sub Macro1()
to
Sub InsertMyAddress()
To assign this to your Quick Access Toolbar (QAT), click on the arrow that points down at the very end of the QAT. Choose «More commands…» This should open the File/Options dialog box at the correct «tab». From the dropdown list at the top left choose
«Macros». Click on the macro, then click the button to ADD it to the list on the right. If you want to see a different icon, click on the macro in the list on the right, then click «Modify». There you can choose a picture and change the «Display name».(I’m looking at Word 2007, where the names of things are a bit different. That’s why I’m not giving you the exact menu names — I don’t want to confuse you!)
Cindy Meister, VSTO/Word MVP
-
Marked as answer by
Calvin_Gao
Monday, July 18, 2011 6:51 AM
-
Marked as answer by