none
Cannot load an instance of the following .NET Framework object: assembly Microsoft.Office.Interop.Excel, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c. RRS feed

  • Question

  • Hello,

    I have 2 environments:

    First:

    • Domain A
    • Windows 10
    • Business Central
    • Office 365 ProPlus

    Second:

    • Domain B
    • Windows 10
    • Business Central
    • Office 365 Business

    I am trying to create Excel file using Business Central (custom code). First environment works fine, but i am getting an error in one second environment. There are 2 computers in both environments, all of them acts the same. Macros work fine in both env.

    Could it be somehow related to Office version Business vs ProPlus?

    If it possible that assembly Microsoft.Office.Interop.Excel is somehow blocked from domain or there is something wrong with policies?..

    What is the easiest way to check if assembly Microsoft.Office.Interop.Excel is accessible from other programs?..

    Any ideas of what i could check would be great, thanks in advance.

    Tuesday, June 25, 2019 6:49 AM

All replies

  • Hi,

    Since this issue is more related to .NET Framework, I'm moving it to the forum:

    https://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=csharpgeneral&filter=alltypes&sort=firstpostdesc

    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.

    If you have questions about Office, you can post to our forum in the future, we will be glad to help you solve it.

    Regards,

    Bella Wu


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnsf@microsoft.com.

    Click here to learn more. Visit the dedicated forum to shareexplore and talk to experts about Microsoft Office 2019. 

    Wednesday, June 26, 2019 6:36 AM
  • Hi PowerName,

    Based on your description, you want to solve the problem that you got.

    Where is your code written, is in excel or in c# program?

    We are waiting for your update.

    Best Regards,

    Jack


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, June 26, 2019 9:00 AM
  • Any ideas of what i could check would be great, thanks in advance.

    .NET is telling you that it cannot find the DLL. It's telling you the namespace of the DLL along with the version number and publickeytoken of the DLL wanted that should be in the same location as the programname.exe, when deployed.

    Where is the DLL the program's manifest is calling for?

    Wednesday, June 26, 2019 11:11 AM
  • ProPlus installs a MSI version of Office.

    365 Business installs a Click To Run version of Office which I think auto updates itself. 

    Office 15 is 2013. You sure you still have Office 2013 instead of Office 2016 on your Office 365 Business machines?



    Visual C++ MVP

    Wednesday, June 26, 2019 2:45 PM
  • Hi Jack J Jun,

    Code is written in C\AL in Microsoft Dynamics 365: Business Central, which basically work as dotnet.

    Business Central is 3-tier architecture (Database, middle tier, user client), and code runs on user client, so these libraries must be installed on user machine.

    My newest findings:

    First (Works):

    • Domain A
    • Windows 10
    • Business Central
    • Office 365 ProPlus (installed with Click to Run)
    • Office 2016 (with .net programability support)
    • Office 2013 (with .net programability support)
    • Office 2010 (with .net programability support)

    Second (Erros):

    • Domain B
    • Windows 10
    • Business Central
    • Office 365 Business  (installed with Click to Run)

    So as i think, the problem is that when installing office with "Click to Run" ".net programability support" is not installed and there is no way to mark it for installation, at least i did not find how to edit installation setup xml.





    • Edited by PowerName Monday, July 1, 2019 10:55 AM
    Monday, July 1, 2019 10:50 AM
  • Hi Sheng Jiang,

    You are correct. On first environment i also had older office versions with (.net programmability support) so that is the reason why it works. 

    How can i install ".net programmability support" while using Click To Run version of Office? I think we do not have installation disks...

    Maybe i can use install old's office ".net programmability support" which does not require licence (or do it) and then install "Click To Run" office version?..

    Monday, July 1, 2019 11:01 AM
  • Hi DA924x,

    My 2 programs are deployed separately, it is Office and Business Central, Business Central uses Office library in code to do stuff, and it can not find\access the library. I am not shore what does "Manifest" means. My knowledge here is "limited".

    Monday, July 1, 2019 11:06 AM
  • Hi Jack J Jun,

    Code is written in C\AL in Microsoft Dynamics 365: Business Central, which basically work as dotnet.

    Business Central is 3-tier architecture (Database, middle tier, user client), and code runs on user client, so these libraries must be installed on user machine.

    My newest findings:

    First (Works):

    • Domain A
    • Windows 10
    • Business Central
    • Office 365 ProPlus (installed with Click to Run)
    • Office 2016 (with .net programability support)
    • Office 2013 (with .net programability support)
    • Office 2010 (with .net programability support)

    Second (Erros):

    • Domain B
    • Windows 10
    • Business Central
    • Office 365 Business  (installed with Click to Run)

    So as i think, the problem is that when installing office with "Click to Run" ".net programability support" is not installed and there is no way to mark it for installation, at least i did not find how to edit installation setup xml.





    It looks to me that this may be a seperation installation on each machine where a DLL or DLL(s) are being installed into the GAC, possibly.

    If the solution worked on a given machine, a development machine, then where is the DLL on that machine that the program is using that is not on a deployed machine?

    Monday, July 1, 2019 11:13 AM
  • The .Net programmability support setup option is only available when you have .Net 3.5 installed or enabled. For .Net 4.0 I think you are supposed to embed interop types. If you can't embed (e.g. still targeting .net 3.5 or also using a faulty type library like SHDocVw in the same project) you need to ship Office PIA,  there's a copy that comes with Visual Studio when you install VSTO. You can also generate your own interop assemblies using tlbimp and ship them- I doubt you need a Microsoft strong name. 



    Visual C++ MVP

    Monday, July 1, 2019 3:35 PM
  • Hi DA924x,

    My 2 programs are deployed separately, it is Office and Business Central, Business Central uses Office library in code to do stuff, and it can not find\access the library. I am not shore what does "Manifest" means. My knowledge here is "limited".

    https://docs.microsoft.com/en-us/dotnet/framework/app-domains/assembly-manifest


    Monday, July 1, 2019 4:52 PM
  • The problem was how office was installed.

    Installation from image includes ".net programability support".

    Installation with "Click to Run" does not include ".net programability support"

    More on this:

    superuser.com/questions/969857/how-to-install-net-programmability-support-for-office-365-proplus

    Monday, July 29, 2019 6:27 AM