[GH-ISSUE #36] Error from WINWORD, library not registered #12

Closed
opened 2026-02-27 20:30:48 +03:00 by kerem · 3 comments
Owner

Originally created by @Imaginos on GitHub (Apr 14, 2022).
Original GitHub issue: https://github.com/Set-OutlookSignatures/Set-OutlookSignatures/issues/36

Originally assigned to: @Imaginos on GitHub.

Hi Markus !
On a few bunch of machines (Win 10, Office 2013) the script raises an error when Word has to open the docx model and process it to create the signatures.

'Get all OOF template files and categorize them @2022-04-13T09:51:29+02:00@

Start Word background process for template editing @2022-04-13T09:51:29+02:00@
Word not installed or not working correctly. Exiting.
Exception lors de l'appel de «Quit» avec «1» argument(s): «Impossible d'effectuer un cast d'un objet COM de type
'Microsoft.Office.Interop.Word.ApplicationClass' en type d'interface 'Microsoft.Office.Interop.Word._Application'.
Cette opération a échoué, car l'appel QueryInterface sur le composant COM pour l'interface avec l'IID
'{00020970-0000-0000-C000-000000000046}' a échoué en raison de l'erreur suivante: Bibliothèque non inscrite.
(Exception de HRESULT : 0x8002801D (TYPE_E_LIBNOTREGISTERED)).»
Au caractère C:\Logiciels\Set-OutlookSignatures\Set-OutlookSignatures.ps1:1486 : 17
+ $script:COMWordDummy.Quit([ref]$false)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : InvalidCastException

Clean-up @2022-04-13T09:51:30+02:00@'

I think this issue is MS related, but have you ever heard about this and what to do ?

Of course, I tried lots of things (including the use of a MS tool aimed to make a full clean of Office prior to reinstall it...

Thanx Markus !

Originally created by @Imaginos on GitHub (Apr 14, 2022). Original GitHub issue: https://github.com/Set-OutlookSignatures/Set-OutlookSignatures/issues/36 Originally assigned to: @Imaginos on GitHub. Hi Markus ! On a few bunch of machines (Win 10, Office 2013) the script raises an error when Word has to open the docx model and process it to create the signatures. 'Get all OOF template files and categorize them @2022-04-13T09:51:29+02:00@ Start Word background process for template editing @2022-04-13T09:51:29+02:00@ Word not installed or not working correctly. Exiting. Exception lors de l'appel de «Quit» avec «1» argument(s): «Impossible d'effectuer un cast d'un objet COM de type 'Microsoft.Office.Interop.Word.ApplicationClass' en type d'interface 'Microsoft.Office.Interop.Word._Application'. Cette opération a échoué, car l'appel QueryInterface sur le composant COM pour l'interface avec l'IID '{00020970-0000-0000-C000-000000000046}' a échoué en raison de l'erreur suivante: Bibliothèque non inscrite. (Exception de HRESULT : 0x8002801D (TYPE_E_LIBNOTREGISTERED)).» Au caractère C:\Logiciels\Set-OutlookSignatures\Set-OutlookSignatures.ps1:1486 : 17 + $script:COMWordDummy.Quit([ref]$false) + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [], MethodInvocationException + FullyQualifiedErrorId : InvalidCastException Clean-up @2022-04-13T09:51:30+02:00@' I think this issue is MS related, but have you ever heard about this and what to do ? Of course, I tried lots of things (including the use of a MS tool aimed to make a full clean of Office prior to reinstall it... Thanx Markus !
kerem 2026-02-27 20:30:48 +03:00
Author
Owner

@GruberMarkus commented on GitHub (Apr 14, 2022):

Hi Imaginos

You are right, this problem is a problem in Word or the Office Interop itself.

I have not seen this error with Word and Set-OutlookSignatures, but with Excel. It was not caused by Excel or Office itself, but by a third-party product wrongly handling Office Interop registry keys.

If repairing and reinstalling do not help, I'd try the following steps:
taskkill /f /im winword.exe
Start Word and see if it asks for document recovery. If yes, this might be the root of the problem
If this does not help, you'll need to compare registry entries for '{00020970-0000-0000-C000-000000000046}' between a working and a non-working client computer.

<!-- gh-comment-id:1099296246 --> @GruberMarkus commented on GitHub (Apr 14, 2022): Hi Imaginos You are right, this problem is a problem in Word or the Office Interop itself. I have not seen this error with Word and Set-OutlookSignatures, but with Excel. It was not caused by Excel or Office itself, but by a third-party product wrongly handling Office Interop registry keys. If repairing and reinstalling do not help, I'd try the following steps: taskkill /f /im winword.exe Start Word and see if it asks for document recovery. If yes, this might be the root of the problem If this does not help, you'll need to compare registry entries for '{00020970-0000-0000-C000-000000000046}' between a working and a non-working client computer.
Author
Owner

@Imaginos commented on GitHub (Apr 15, 2022):

Yes !
The solution is quite simple !
In regedit, i found \HKEY_CLASSES_ROOT\Interface{00020936-0000-0000-C000-000000000046}\TypeLib with a default value set to {00020905-0000-0000-C000-000000000046}.
Then I go to \HKEY_CLASSES_ROOT\TypeLib{00020905-0000-0000-C000-000000000046}\ and find 2 sub keys : 8.6 and 8.7
8.7 was empty and should not be. I deleted this empty key, leaving 8.6 with it's data.

After that, the script works fine (no need to reboot or anything else) !

Hope it will help if someone else encounter this (it seems to happen more often than it should).

Bye,
Tom

<!-- gh-comment-id:1099961675 --> @Imaginos commented on GitHub (Apr 15, 2022): Yes ! The solution is quite simple ! In regedit, i found \HKEY_CLASSES_ROOT\Interface\{00020936-0000-0000-C000-000000000046}\TypeLib with a default value set to {00020905-0000-0000-C000-000000000046}. Then I go to \HKEY_CLASSES_ROOT\TypeLib\{00020905-0000-0000-C000-000000000046}\ and find 2 sub keys : 8.6 and 8.7 8.7 was empty and should not be. I deleted this empty key, leaving 8.6 with it's data. After that, the script works fine (no need to reboot or anything else) ! Hope it will help if someone else encounter this (it seems to happen more often than it should). Bye, Tom
Author
Owner

@Imaginos commented on GitHub (Oct 11, 2022):

OK Markus, I'll try to explore the registry. I already tried the rest :)

I'll let you know, it can be useful !

See ya
Tom

Le jeu. 14 avr. 2022 à 17:21, Markus Gruber @.***> a
écrit :

Hi Imaginos

You are right, this problem is a problem in Word or the Office Interop
itself.

I have not seen this error with Word and Set-OutlookSignatures, but with
Excel. It was not caused by Excel or Office itself, but by a third-party
product wrongly handling Office Interop registry keys.

If repairing and reinstalling do not help, I'd try the following steps:
taskkill /f /im winword.exe
Start Word and see if it asks for document recovery. If yes, this might be
the root of the problem
If this does not help, you'll need to compare registry entries for
'{00020970-0000-0000-C000-000000000046}' between a working and a
non-working client computer.


Reply to this email directly, view it on GitHub
https://github.com/GruberMarkus/Set-OutlookSignatures/issues/36#issuecomment-1099296246,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAASCNGFY7PPSINQLHYGV3DVFAZYXANCNFSM5TNYU5KQ
.
You are receiving this because you were assigned.Message ID:
@.***>

<!-- gh-comment-id:1274331357 --> @Imaginos commented on GitHub (Oct 11, 2022): OK Markus, I'll try to explore the registry. I already tried the rest :) I'll let you know, it can be useful ! See ya Tom Le jeu. 14 avr. 2022 à 17:21, Markus Gruber ***@***.***> a écrit : > Hi Imaginos > > You are right, this problem is a problem in Word or the Office Interop > itself. > > I have not seen this error with Word and Set-OutlookSignatures, but with > Excel. It was not caused by Excel or Office itself, but by a third-party > product wrongly handling Office Interop registry keys. > > If repairing and reinstalling do not help, I'd try the following steps: > taskkill /f /im winword.exe > Start Word and see if it asks for document recovery. If yes, this might be > the root of the problem > If this does not help, you'll need to compare registry entries for > '{00020970-0000-0000-C000-000000000046}' between a working and a > non-working client computer. > > — > Reply to this email directly, view it on GitHub > <https://github.com/GruberMarkus/Set-OutlookSignatures/issues/36#issuecomment-1099296246>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/AAASCNGFY7PPSINQLHYGV3DVFAZYXANCNFSM5TNYU5KQ> > . > You are receiving this because you were assigned.Message ID: > ***@***.***> >
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/Set-OutlookSignatures-Set-OutlookSignatures#12
No description provided.