Office / Word interop fails with “Element not found” error





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







2















I'm trying to use Office interop library but whenever I try to create a new instance of Word Application class I get an exception of:



System.Runtime.InteropServices.COMException (0x80070490): 
Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error:
80070490 Element not found. (Exception from HRESULT: 0x80070490).


Exception is thrown at Application object creation.



class Program
{
static void Main(string args)
{
var application = new Microsoft.Office.Interop.Word.Application();
}
}


Test project had latest Microsoft.Office.Interop.Word nuget package (15.0.4797.1003).



For testing purposes I've tried to do the same for Excel interop but I get similar exception (with different CLSID that is).



My computer has Office 2016 installed. I've tried reinstalling Office partially or completely but that has not helped.



I can find registry entries for the object that is mentioned in exception as not found.



Interestingly I've noticed that this problem only bothers two out of four machines I've tested it on. All of the PCs have similar configuration, the same version of Office installed (and only this version).










share|improve this question




















  • 1





    Are you able to find the CLSID mentioned in the error in the Registry? If Word (Office) is already installed it would be best to you that set of PIAs, not something you've downloaded and are distributing with the project. The PIAs are installed by default when Office is installed. Try setting a reference to the PIAs via the COM tab in Visual Studio - that will look in the GAC for the PIAs. (And don't forget to "ping" me using @ if you want me to be aware of any updates or replies.)

    – Cindy Meister
    Nov 27 '18 at 14:33













  • Yes I was able to find this exact CLSID in the Registry. I can confirm that PIAs were installed with the Office installation. I've tried removing them and than installing again but that has not helped. So has full Office 2016 reinstallation. I also tried COM reference to required library but that has no effect on exception.

    – Dawid Kowalski
    Nov 27 '18 at 14:37











  • Did you try repairing Office? Uninstall/reinstall won't necessarily affect the Registry keys involved. And I repeat: if you want a discussion do use the "ping" functionality otherwise I won't know you've replied to a comment.

    – Cindy Meister
    Nov 27 '18 at 14:59











  • Thank you @CindyMeister - I had tried the repair as well. I'm happy with that installation of Office 2019 helped.

    – Dawid Kowalski
    Nov 27 '18 at 15:02




















2















I'm trying to use Office interop library but whenever I try to create a new instance of Word Application class I get an exception of:



System.Runtime.InteropServices.COMException (0x80070490): 
Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error:
80070490 Element not found. (Exception from HRESULT: 0x80070490).


Exception is thrown at Application object creation.



class Program
{
static void Main(string args)
{
var application = new Microsoft.Office.Interop.Word.Application();
}
}


Test project had latest Microsoft.Office.Interop.Word nuget package (15.0.4797.1003).



For testing purposes I've tried to do the same for Excel interop but I get similar exception (with different CLSID that is).



My computer has Office 2016 installed. I've tried reinstalling Office partially or completely but that has not helped.



I can find registry entries for the object that is mentioned in exception as not found.



Interestingly I've noticed that this problem only bothers two out of four machines I've tested it on. All of the PCs have similar configuration, the same version of Office installed (and only this version).










share|improve this question




















  • 1





    Are you able to find the CLSID mentioned in the error in the Registry? If Word (Office) is already installed it would be best to you that set of PIAs, not something you've downloaded and are distributing with the project. The PIAs are installed by default when Office is installed. Try setting a reference to the PIAs via the COM tab in Visual Studio - that will look in the GAC for the PIAs. (And don't forget to "ping" me using @ if you want me to be aware of any updates or replies.)

    – Cindy Meister
    Nov 27 '18 at 14:33













  • Yes I was able to find this exact CLSID in the Registry. I can confirm that PIAs were installed with the Office installation. I've tried removing them and than installing again but that has not helped. So has full Office 2016 reinstallation. I also tried COM reference to required library but that has no effect on exception.

    – Dawid Kowalski
    Nov 27 '18 at 14:37











  • Did you try repairing Office? Uninstall/reinstall won't necessarily affect the Registry keys involved. And I repeat: if you want a discussion do use the "ping" functionality otherwise I won't know you've replied to a comment.

    – Cindy Meister
    Nov 27 '18 at 14:59











  • Thank you @CindyMeister - I had tried the repair as well. I'm happy with that installation of Office 2019 helped.

    – Dawid Kowalski
    Nov 27 '18 at 15:02
















2












2








2


1






I'm trying to use Office interop library but whenever I try to create a new instance of Word Application class I get an exception of:



System.Runtime.InteropServices.COMException (0x80070490): 
Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error:
80070490 Element not found. (Exception from HRESULT: 0x80070490).


Exception is thrown at Application object creation.



class Program
{
static void Main(string args)
{
var application = new Microsoft.Office.Interop.Word.Application();
}
}


Test project had latest Microsoft.Office.Interop.Word nuget package (15.0.4797.1003).



For testing purposes I've tried to do the same for Excel interop but I get similar exception (with different CLSID that is).



My computer has Office 2016 installed. I've tried reinstalling Office partially or completely but that has not helped.



I can find registry entries for the object that is mentioned in exception as not found.



Interestingly I've noticed that this problem only bothers two out of four machines I've tested it on. All of the PCs have similar configuration, the same version of Office installed (and only this version).










share|improve this question
















I'm trying to use Office interop library but whenever I try to create a new instance of Word Application class I get an exception of:



System.Runtime.InteropServices.COMException (0x80070490): 
Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error:
80070490 Element not found. (Exception from HRESULT: 0x80070490).


Exception is thrown at Application object creation.



class Program
{
static void Main(string args)
{
var application = new Microsoft.Office.Interop.Word.Application();
}
}


Test project had latest Microsoft.Office.Interop.Word nuget package (15.0.4797.1003).



For testing purposes I've tried to do the same for Excel interop but I get similar exception (with different CLSID that is).



My computer has Office 2016 installed. I've tried reinstalling Office partially or completely but that has not helped.



I can find registry entries for the object that is mentioned in exception as not found.



Interestingly I've noticed that this problem only bothers two out of four machines I've tested it on. All of the PCs have similar configuration, the same version of Office installed (and only this version).







.net ms-word office-interop






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 26 '18 at 17:09







Dawid Kowalski

















asked Nov 26 '18 at 15:24









Dawid KowalskiDawid Kowalski

6771621




6771621








  • 1





    Are you able to find the CLSID mentioned in the error in the Registry? If Word (Office) is already installed it would be best to you that set of PIAs, not something you've downloaded and are distributing with the project. The PIAs are installed by default when Office is installed. Try setting a reference to the PIAs via the COM tab in Visual Studio - that will look in the GAC for the PIAs. (And don't forget to "ping" me using @ if you want me to be aware of any updates or replies.)

    – Cindy Meister
    Nov 27 '18 at 14:33













  • Yes I was able to find this exact CLSID in the Registry. I can confirm that PIAs were installed with the Office installation. I've tried removing them and than installing again but that has not helped. So has full Office 2016 reinstallation. I also tried COM reference to required library but that has no effect on exception.

    – Dawid Kowalski
    Nov 27 '18 at 14:37











  • Did you try repairing Office? Uninstall/reinstall won't necessarily affect the Registry keys involved. And I repeat: if you want a discussion do use the "ping" functionality otherwise I won't know you've replied to a comment.

    – Cindy Meister
    Nov 27 '18 at 14:59











  • Thank you @CindyMeister - I had tried the repair as well. I'm happy with that installation of Office 2019 helped.

    – Dawid Kowalski
    Nov 27 '18 at 15:02
















  • 1





    Are you able to find the CLSID mentioned in the error in the Registry? If Word (Office) is already installed it would be best to you that set of PIAs, not something you've downloaded and are distributing with the project. The PIAs are installed by default when Office is installed. Try setting a reference to the PIAs via the COM tab in Visual Studio - that will look in the GAC for the PIAs. (And don't forget to "ping" me using @ if you want me to be aware of any updates or replies.)

    – Cindy Meister
    Nov 27 '18 at 14:33













  • Yes I was able to find this exact CLSID in the Registry. I can confirm that PIAs were installed with the Office installation. I've tried removing them and than installing again but that has not helped. So has full Office 2016 reinstallation. I also tried COM reference to required library but that has no effect on exception.

    – Dawid Kowalski
    Nov 27 '18 at 14:37











  • Did you try repairing Office? Uninstall/reinstall won't necessarily affect the Registry keys involved. And I repeat: if you want a discussion do use the "ping" functionality otherwise I won't know you've replied to a comment.

    – Cindy Meister
    Nov 27 '18 at 14:59











  • Thank you @CindyMeister - I had tried the repair as well. I'm happy with that installation of Office 2019 helped.

    – Dawid Kowalski
    Nov 27 '18 at 15:02










1




1





Are you able to find the CLSID mentioned in the error in the Registry? If Word (Office) is already installed it would be best to you that set of PIAs, not something you've downloaded and are distributing with the project. The PIAs are installed by default when Office is installed. Try setting a reference to the PIAs via the COM tab in Visual Studio - that will look in the GAC for the PIAs. (And don't forget to "ping" me using @ if you want me to be aware of any updates or replies.)

– Cindy Meister
Nov 27 '18 at 14:33







Are you able to find the CLSID mentioned in the error in the Registry? If Word (Office) is already installed it would be best to you that set of PIAs, not something you've downloaded and are distributing with the project. The PIAs are installed by default when Office is installed. Try setting a reference to the PIAs via the COM tab in Visual Studio - that will look in the GAC for the PIAs. (And don't forget to "ping" me using @ if you want me to be aware of any updates or replies.)

– Cindy Meister
Nov 27 '18 at 14:33















Yes I was able to find this exact CLSID in the Registry. I can confirm that PIAs were installed with the Office installation. I've tried removing them and than installing again but that has not helped. So has full Office 2016 reinstallation. I also tried COM reference to required library but that has no effect on exception.

– Dawid Kowalski
Nov 27 '18 at 14:37





Yes I was able to find this exact CLSID in the Registry. I can confirm that PIAs were installed with the Office installation. I've tried removing them and than installing again but that has not helped. So has full Office 2016 reinstallation. I also tried COM reference to required library but that has no effect on exception.

– Dawid Kowalski
Nov 27 '18 at 14:37













Did you try repairing Office? Uninstall/reinstall won't necessarily affect the Registry keys involved. And I repeat: if you want a discussion do use the "ping" functionality otherwise I won't know you've replied to a comment.

– Cindy Meister
Nov 27 '18 at 14:59





Did you try repairing Office? Uninstall/reinstall won't necessarily affect the Registry keys involved. And I repeat: if you want a discussion do use the "ping" functionality otherwise I won't know you've replied to a comment.

– Cindy Meister
Nov 27 '18 at 14:59













Thank you @CindyMeister - I had tried the repair as well. I'm happy with that installation of Office 2019 helped.

– Dawid Kowalski
Nov 27 '18 at 15:02







Thank you @CindyMeister - I had tried the repair as well. I'm happy with that installation of Office 2019 helped.

– Dawid Kowalski
Nov 27 '18 at 15:02














1 Answer
1






active

oldest

votes


















0














This issue was solved by installation of Office 2019.



It does not solve the underlying issue for somebody bound to Office 2016, but the fact that new Office version helped would suggest that it is something about broken installation. However for me even full uninstall / reinstall of Office 2016 did not help.






share|improve this answer
























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53484297%2foffice-word-interop-fails-with-element-not-found-error%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    This issue was solved by installation of Office 2019.



    It does not solve the underlying issue for somebody bound to Office 2016, but the fact that new Office version helped would suggest that it is something about broken installation. However for me even full uninstall / reinstall of Office 2016 did not help.






    share|improve this answer




























      0














      This issue was solved by installation of Office 2019.



      It does not solve the underlying issue for somebody bound to Office 2016, but the fact that new Office version helped would suggest that it is something about broken installation. However for me even full uninstall / reinstall of Office 2016 did not help.






      share|improve this answer


























        0












        0








        0







        This issue was solved by installation of Office 2019.



        It does not solve the underlying issue for somebody bound to Office 2016, but the fact that new Office version helped would suggest that it is something about broken installation. However for me even full uninstall / reinstall of Office 2016 did not help.






        share|improve this answer













        This issue was solved by installation of Office 2019.



        It does not solve the underlying issue for somebody bound to Office 2016, but the fact that new Office version helped would suggest that it is something about broken installation. However for me even full uninstall / reinstall of Office 2016 did not help.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 27 '18 at 14:41









        Dawid KowalskiDawid Kowalski

        6771621




        6771621
































            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53484297%2foffice-word-interop-fails-with-element-not-found-error%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Wiesbaden

            Marschland

            Dieringhausen