Excel com exception, registry key lacking values {000208D5-0000-0000-C000-000000000046}

  • Thread starter Thread starter Bikkebakke
  • Start date Start date
B

Bikkebakke

Guest
I have a problem when trying to use excel functions within my program.


First off, there's nothing wrong with the code itself or any references. I've already included everything that is necessary and a colleague of mine have tried this code on his computer and it works there. The problem lies within my registry keys.

Beneath is the reference in QD:

<I CANT ADD IMAGES SINCE MY ACCOUNT ISN'T VERIFIED YET AND I CAN'T REALLY SIT AROUND AND WAIT FOR THAT SO I'LL JUST EXPLAIN IT IN TEXT>

The reference is "Microsoft.Office.Interop.Word" Description is Microsoft Word 16.0 Object Library. Identity is: "{00020905-0000-0000-C000-000000000046}\8.7\0\primary". Version 8.7.0.0.

When I run my program I get this error:

<ONCE AGAIN THERE SHOULD BE AN IMAGE HERE>

"System.InvalidCastException: 'Det går inte att omvandla COM-objekt av typen Microsoft.Office.Interop.Excel.ApplicationClass till gränssnitt av typen Microsoft.Office.Interop.Excel._Application. Den här åtgärden misslyckades eftersom QueryInterface-anropet i COM-komponenten för gränssnittet med IID {000208D5-0000-0000-C000-000000000046} misslyckades på grund av följande fel: Gränssnittet har inte registrerats (Undantag från HRESULT:0x80040155).'"


Sorry for the swedish, but in general it complains that the Query interface call failed in the com component due to the related IID weren't registered {000208D5-0000-0000-C000-000000000046}.


I looked up the {000208D5-0000-0000-C000-000000000046} key and found them twice, once in "Dator\HKEY_CLASSES_ROOT\WOW6432Node\Interface\" and one in "Dator\HKEY_CLASSES_ROOT\Interface\". As I understand the WOW6432Node is for the 64bit installation of office and the other is for the 32 bit installation?

<THERE SHOULD BE AN IMAGE HERE DISPLAYING REGEDIT WITH A KEY AND VALUES, I'LL TYPE IT BELOW MANUALLY AS I CAN'T ADD IMAGES:>

Dator\HKEY_CLASSES_ROOT\Interface\{000208D5-0000-0000-C000-000000000046}
TEXT DATA: "_Application"

Dator\HKEY_CLASSES_ROOT\Interface\{000208D5-0000-0000-C000-000000000046}\ProxyStubClsid32
(Standard): {00020424-0000-0000-C000-000000000046}

Dator\HKEY_CLASSES_ROOT\Interface\{000208D5-0000-0000-C000-000000000046}\TypeLib
(Standard): {00020813-0000-0000-C000-000000000046}
Version: 1.9

<SECOND KEY ENTRY>

Dator\HKEY_CLASSES_ROOT\WOW6432Node\Interface\{000208D5-0000-0000-C000-000000000046}
(Standard): No value has been given

Dator\HKEY_CLASSES_ROOT\WOW6432Node\Interface\{000208D5-0000-0000-C000-000000000046}\ProxyStubClsid32
(Standard): <empty>

Dator\HKEY_CLASSES_ROOT\WOW6432Node\Interface\{000208D5-0000-0000-C000-000000000046}\TypeLib
(Standard): <empty>



Above are the two keys, but the WOW64 version has no values tied to its strings plus its missing the version string, it's this that is causing my error (I presume). I tried just changing (just for the fun of it) the value of the WOW64 version to the same values as the Interface one, and then I got another error telling me that these pointers where invalid. I mostly just did this to see if WOW64 node actually were the one my program tries to access, and it seems it is.


I've also uninstalled office and reinstalled it completely, I've also done repair on office, both the normal one and the online repair. None fixes the problem.


So right now I'm stuck here not getting anywhere because the key's values are empty and I don't know what they are supposed to contain, and office reinstallations won't fill them correctly when re-installing or repairing.


There also is a problem with my "{00020905-0000-0000-C000-000000000046}" key (the one connected to Interop reference), it contains both 8.6 and 8.7 keys but the 8.6 one contains null values and says I can't read from it, and I know this has been a problem for others when programming with Excel. It seems to contain a nullvalue that stops me from deleting and reading it properly. I've tried running a program that's supposed to put my user account as the owner of this key, but that doesn't do much, and I've also run a program that's supposed to clear nullvalues but it didn't do much to clear my error.

Apart from that I've also tried exporting the parent key, then edit the content. By doing that I can make it so that I can actually access the 8.6 key and read it's values, but if I try to remove it it still complains. Though this is a latter issue, or it might not even be an issue if the first one is resolved.

Any help regarding this would be nice. At the moment I'm stuck with not being able to use excel in my programming as I can't get past this error, and the help I've searched for online haven't done much for me.


Also sorry if this is in the wrong section since it's not really about C# coding directly.

Continue reading...
 
Back
Top