Visual basic runtime error 5981

Application-defind or object-defind error Номер ошибки 5981 VBA Решение и ответ на вопрос 2426405

2 / 2 / 0

Регистрация: 26.11.2016

Сообщений: 90

1

27.03.2019, 14:57. Показов 3413. Ответов 3


Здравствуйте, уважаемые форумчане!
Есть код, который заполняет шаблон Word (расширение .dotx), данными из таблицы Excel.
Но есть проблема: на одном компьютере код работает отлично, а на другом в момент создания документа выбивается ошибка: application-defind or object-defind error Номер ошибки 5981. Происходит она вот в этой строке:
Set WD = WA.Documents.Add(путь к папке с шаблоном и его имя).
Что может быть не так?

__________________
Помощь в написании контрольных, курсовых и дипломных работ, диссертаций здесь



0



ᴁ®

Эксперт MS Access

2918 / 1624 / 340

Регистрация: 13.12.2016

Сообщений: 5,490

Записей в блоге: 3

27.03.2019, 15:00

2

vasilisaegorovn, скорее всего не правильно зарегистрирована библиотека. Разрядность компов разная.
Проверьте библиотеки на сбойном. (Referens)



1



2 / 2 / 0

Регистрация: 26.11.2016

Сообщений: 90

27.03.2019, 18:13

 [ТС]

3

АЕ, в решении проблемы на втором компьютере помогло следующее:
Сделала приложение ворд visible=true. И когда выбило ошибку — зашла в открытый на основе шаблона документ и нажала там «Разрешить редактировать». Затем вернула visible=false. И теперь все работает.
НО!!! как избежать этого при передаче файла другим пользователям, у которых потенциально тоже может возникнуть эта ошибка?

Добавлено через 1 час 33 минуты
Вдруг кто столкнётся с такой же проблемой и вот решение: нужно в свойствах переданного по интернету шаблона разрешить его редактирование)
Всем спасибо!



1



ᴁ®

Эксперт MS Access

2918 / 1624 / 340

Регистрация: 13.12.2016

Сообщений: 5,490

Записей в блоге: 3

27.03.2019, 21:29

4

Цитата
Сообщение от vasilisaegorovn
Посмотреть сообщение

свойствах переданного по интернету шаблона разрешить его редактирование

Как правило это определенная папка. Вот ее и надо в параметрах безопасности ворда указать как довереное расположение



0



How to fix the Runtime Code 5981 Microsoft Word Error 5981

This article features error number Code 5981, commonly known as Microsoft Word Error 5981 described as Error 5981: Microsoft Word has encountered a problem and needs to close. We are sorry for the inconvenience.

About Runtime Code 5981

Runtime Code 5981 happens when Microsoft Word fails or crashes whilst it’s running, hence its name. It doesn’t necessarily mean that the code was corrupt in some way, but just that it did not work during its run-time. This kind of error will appear as an annoying notification on your screen unless handled and corrected. Here are symptoms, causes and ways to troubleshoot the problem.

Definitions (Beta)

Here we list some definitions for the words contained in your error, in an attempt to help you understand your problem. This is a work in progress, so sometimes we might define the word incorrectly, so feel free to skip this section!

  • Microsoft word — For programming questions related to Microsoft’s «Word» editor

Symptoms of Code 5981 — Microsoft Word Error 5981

Runtime errors happen without warning. The error message can come up the screen anytime Microsoft Word is run. In fact, the error message or some other dialogue box can come up again and again if not addressed early on.

There may be instances of files deletion or new files appearing. Though this symptom is largely due to virus infection, it can be attributed as a symptom for runtime error, as virus infection is one of the causes for runtime error. User may also experience a sudden drop in internet connection speed, yet again, this is not always the case.

Fix Microsoft Word Error 5981 (Error Code 5981)
(For illustrative purposes only)

Causes of Microsoft Word Error 5981 — Code 5981

During software design, programmers code anticipating the occurrence of errors. However, there are no perfect designs, as errors can be expected even with the best program design. Glitches can happen during runtime if a certain error is not experienced and addressed during design and testing.

Runtime errors are generally caused by incompatible programs running at the same time. It may also occur because of memory problem, a bad graphics driver or virus infection. Whatever the case may be, the problem must be resolved immediately to avoid further problems. Here are ways to remedy the error.

Repair Methods

Runtime errors may be annoying and persistent, but it is not totally hopeless, repairs are available. Here are ways to do it.

If a repair method works for you, please click the upvote button to the left of the answer, this will let other users know which repair method is currently working the best.

Please note: Neither ErrorVault.com nor it’s writers claim responsibility for the results of the actions taken from employing any of the repair methods listed on this page — you complete these steps at your own risk.

Method 1 — Close Conflicting Programs

When you get a runtime error, keep in mind that it is happening due to programs that are conflicting with each other. The first thing you can do to resolve the problem is to stop these conflicting programs.

  • Open Task Manager by clicking Ctrl-Alt-Del at the same time. This will let you see the list of programs currently running.
  • Go to the Processes tab and stop the programs one by one by highlighting each program and clicking the End Process buttom.
  • You will need to observe if the error message will reoccur each time you stop a process.
  • Once you get to identify which program is causing the error, you may go ahead with the next troubleshooting step, reinstalling the application.

Method 2 — Update / Reinstall Conflicting Programs

Using Control Panel

  • For Windows 7, click the Start Button, then click Control panel, then Uninstall a program
  • For Windows 8, click the Start Button, then scroll down and click More Settings, then click Control panel > Uninstall a program.
  • For Windows 10, just type Control Panel on the search box and click the result, then click Uninstall a program
  • Once inside Programs and Features, click the problem program and click Update or Uninstall.
  • If you chose to update, then you will just need to follow the prompt to complete the process, however if you chose to Uninstall, you will follow the prompt to uninstall and then re-download or use the application’s installation disk to reinstall the program.

Using Other Methods

  • For Windows 7, you may find the list of all installed programs when you click Start and scroll your mouse over the list that appear on the tab. You may see on that list utility for uninstalling the program. You may go ahead and uninstall using utilities available in this tab.
  • For Windows 10, you may click Start, then Settings, then choose Apps.
  • Scroll down to see the list of Apps and features installed in your computer.
  • Click the Program which is causing the runtime error, then you may choose to uninstall or click Advanced options to reset the application.

Method 3 — Update your Virus protection program or download and install the latest Windows Update

Virus infection causing runtime error on your computer must immediately be prevented, quarantined or deleted. Make sure you update your virus program and run a thorough scan of the computer or, run Windows update so you can get the latest virus definition and fix.

Method 4 — Re-install Runtime Libraries

You might be getting the error because of an update, like the MS Visual C++ package which might not be installed properly or completely. What you can do then is to uninstall the current package and install a fresh copy.

  • Uninstall the package by going to Programs and Features, find and highlight the Microsoft Visual C++ Redistributable Package.
  • Click Uninstall on top of the list, and when it is done, reboot your computer.
  • Download the latest redistributable package from Microsoft then install it.

Method 5 — Run Disk Cleanup

You might also be experiencing runtime error because of a very low free space on your computer.

  • You should consider backing up your files and freeing up space on your hard drive
  • You can also clear your cache and reboot your computer
  • You can also run Disk Cleanup, open your explorer window and right click your main directory (this is usually C: )
  • Click Properties and then click Disk Cleanup

Method 6 — Reinstall Your Graphics Driver

If the error is related to a bad graphics driver, then you may do the following:

  • Open your Device Manager, locate the graphics driver
  • Right click the video card driver then click uninstall, then restart your computer

Method 7 — IE related Runtime Error

If the error you are getting is related to the Internet Explorer, you may do the following:

  1. Reset your browser.
    • For Windows 7, you may click Start, go to Control Panel, then click Internet Options on the left side. Then you can click Advanced tab then click the Reset button.
    • For Windows 8 and 10, you may click search and type Internet Options, then go to Advanced tab and click Reset.
  2. Disable script debugging and error notifications.
    • On the same Internet Options window, you may go to Advanced tab and look for Disable script debugging
    • Put a check mark on the radio button
    • At the same time, uncheck the «Display a Notification about every Script Error» item and then click Apply and OK, then reboot your computer.

If these quick fixes do not work, you can always backup files and run repair reinstall on your computer. However, you can do that later when the solutions listed here did not do the job.

Other languages:

Wie beheben Fehler 5981 (Microsoft Word-Fehler 5981) — Fehler 5981: Microsoft Word hat ein Problem festgestellt und muss geschlossen werden. Wir entschuldigen uns für die Unannehmlichkeiten.
Come fissare Errore 5981 (Errore 5981 di Microsoft Word) — Errore 5981: Microsoft Word ha riscontrato un problema e deve essere chiuso. Ci scusiamo per l’inconveniente.
Hoe maak je Fout 5981 (Microsoft Word-fout 5981) — Fout 5981: Microsoft Word heeft een probleem ondervonden en moet worden afgesloten. Excuses voor het ongemak.
Comment réparer Erreur 5981 (Erreur Microsoft Word 5981) — Erreur 5981 : Microsoft Word a rencontré un problème et doit se fermer. Nous sommes désolés du dérangement.
어떻게 고치는 지 오류 5981 (마이크로소프트 워드 오류 5981) — 오류 5981: Microsoft Word에 문제가 발생해 닫아야 합니다. 불편을 끼쳐드려 죄송합니다.
Como corrigir o Erro 5981 (Erro 5981 do Microsoft Word) — Erro 5981: O Microsoft Word encontrou um problema e precisa fechar. Lamentamos o inconveniente.
Hur man åtgärdar Fel 5981 (Microsoft Word-fel 5981) — Fel 5981: Microsoft Word har stött på ett problem och måste avslutas. Vi är ledsna för besväret.
Как исправить Ошибка 5981 (Ошибка Microsoft Word 5981) — Ошибка 5981: Возникла ошибка в приложении Microsoft Word. Приложение будет закрыто. Приносим свои извинения за неудобства.
Jak naprawić Błąd 5981 (Błąd Microsoft Word 5981) — Błąd 5981: Microsoft Word napotkał problem i musi zostać zamknięty. Przepraszamy za niedogodności.
Cómo arreglar Error 5981 (Error 5981 de Microsoft Word) — Error 5981: Microsoft Word ha detectado un problema y debe cerrarse. Lamentamos las molestias.

The Author About The Author: Phil Hart has been a Microsoft Community Contributor since 2010. With a current point score over 100,000, they’ve contributed more than 3000 answers in the Microsoft Support forums and have created almost 200 new help articles in the Technet Wiki.

Follow Us: Facebook Youtube Twitter

Last Updated:

11/04/22 07:16 : A iPhone user voted that repair method 2 worked for them.

Recommended Repair Tool:

This repair tool can fix common computer problems such as blue screens, crashes and freezes, missing DLL files, as well as repair malware/virus damage and more by replacing damaged and missing system files.

STEP 1:

Click Here to Download and install the Windows repair tool.

STEP 2:

Click on Start Scan and let it analyze your device.

STEP 3:

Click on Repair All to fix all of the issues it detected.

DOWNLOAD NOW

Compatibility

Requirements

1 Ghz CPU, 512 MB RAM, 40 GB HDD
This download offers unlimited scans of your Windows PC for free. Full system repairs start at $19.95.

Article ID: ACX08353EN

Applies To: Windows 10, Windows 8.1, Windows 7, Windows Vista, Windows XP, Windows 2000

Speed Up Tip #27

Troubleshooting Slow Right-Click Context Menu:

Slow appearing right-click context menu is a common yet very annoying problem in Windows. Troubleshoot the issue by checking on your third-party extensions, graphics driver and registry keys. Also, check the installed programs on your computer as they would sometimes interfere with the right-click process.

Click Here for another way to speed up your Windows PC

Microsoft & Windows® logos are registered trademarks of Microsoft. Disclaimer: ErrorVault.com is not affiliated with Microsoft, nor does it claim such affiliation. This page may contain definitions from https://stackoverflow.com/tags under the CC-BY-SA license. The information on this page is provided for informational purposes only. © Copyright 2018

INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Thanks. We have received your request and will respond promptly.

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!

  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It’s Free!

*Tek-Tips’s functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Run-time error ‘5981’ — Could not open Macro Storage

Run-time error ‘5981’ — Could not open Macro Storage

(OP)

30 Apr 01 13:51

Does anybody know what this error message means. . . .»Run-time error ‘5981’ — Could not Open Macro Storage»?  I have a program in VBA set up for our employees so that they keep track of the amount of work that they do (they are secretaries).  Each time they work on a document, they click on the program, which then automatically inserts the number of characters of that document into another page to be added up in order to calculate their incentive bonus.  There are many different templates (in Word) that they use to do their work and one template in particular seems to be giving this error when they click on their incentive program that I have created.  It has been working fine for months and then it just started to do this late last week.  When I hit «debug», it brings me to the line of code that says «With ActiveDocument».  Also, when I go to open up this actual template itself, it gives me the same error message.  I do not know a lot about error handling so any help would be apprecitated.  Thanks.

Bronwyn

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Join Tek-Tips® Today!

Join your peers on the Internet’s largest technical computer professional community.
It’s easy to join and it’s free.

Here’s Why Members Love Tek-Tips Forums:

  • Tek-Tips ForumsTalk To Other Members
  • Notification Of Responses To Questions
  • Favorite Forums One Click Access
  • Keyword Search Of All Posts, And More…

Register now while it’s still free!

Already a member? Close this window and log in.

Join Us             Close

  • Home
  • VBForums
  • Visual Basic
  • Visual Basic 6 and Earlier
  • Run Time Error ‘5981’ — Could not open macro storage — What does this mean??

  1. Aug 17th, 2001, 10:42 AM


    #1

    csf is offline

    Thread Starter


    Addicted Member


    Question Run Time Error ‘5981’ — Could not open macro storage — What does this mean??

    Hi,

    Do you know what the following error message means? It is driving me crazy.

    Run Time Error ‘5981’ — Could not open macro storage

    I am using IE 5.5 and Word 97 SP2 running on Windows 98.

    Thanks,

    Chris


  2. Aug 17th, 2001, 10:48 AM


    #2

    MartinSmith is offline


    Fanatic Member



  3. Aug 17th, 2001, 11:00 AM


    #3

    csf is offline

    Thread Starter


    Addicted Member


    Thanks for the feedback Martin, however, I checked this one out already to no avail

    It’s a pretty bizarre problem, because it doesn’t happen every time.


  • Home
  • VBForums
  • Visual Basic
  • Visual Basic 6 and Earlier
  • Run Time Error ‘5981’ — Could not open macro storage — What does this mean??


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
  • BB code is On
  • Smilies are On
  • [IMG] code is On
  • [VIDEO] code is On
  • HTML code is Off

Forum Rules


Click Here to Expand Forum to Full Width

Понравилась статья? Поделить с друзьями:
  • Visual basic on error goto
  • Visual basic error 400
  • Visual basic compile error syntax error
  • Visit workshop мерседес значение ошибки
  • Visit workshop display faulty w203 ошибка