Microsoft Office Interop Assemblies 2016

Active11 months ago

I'm trying to add a reference to 'Microsoft Outlook 16.0 Object Library' in a C# .NET 4.6.1 WPF project, because I have office 2016 installed. Previous versions of the Object Library are incompatible with the 2016 version of office.

If I use Excel's VBA editor, 'Microsoft Outlook 16.0 Object Library' is listed, and exists in C:Program FilesWindowsAppsMicrosoft.Office.Desktop_16010.9126.2116.0_x86_8wekyb3d8bbweVFSProgramFilesCommonX86Microsoft SharedOFFICE16MSOUTL.OLB, as you can see below:

However, when I use Visual Studio, the COM tab does not list 'Microsoft Office 16.0 Object Library', and when I try to browse to C:Program FilesWindowsApps, i get 'You dont currently have permission to access this folder', and clicking 'Continue' (to get access) results in 'You have been denied permission to access this folder'.

So basically, the Office 2016 dlls seem to have been tucked away in a folder that is inaccessible to man, dog, and local administrator.

  • If so, Office 2016 Primary Interop Assemblies will be installed, and you could use Microsoft Excel 16.0 Object Library in COM Tab. I suggest you check Microsoft Excel 16.0 Object Library instead of Microsoft.Office 16.0 Object Library.
  • Dotnet add package Microsoft.Office.Interop.Word -version 15.0.4797.1003 The XAML SDK is an easy-to-use infrastructure with 1000+ developer focused examples for most of the Telerik WPF and Silverlight controls. File Converter is a very simple tool which allows you to convert and compress one.

The code worked fine but after Office 2016 installation i have seen that i couldn't use using Excel = Microsoft.Office.Interop.Excel; The only compatible library that i found is. Microsoft.Office.Core (Microsoft Office 16.0 Object Library) I could't find any examples accesing Excel files. Paket add Microsoft.Office.Interop.Excel -version 15.0.4795.1000 The NuGet Team does not provide support for this client. Please contact its maintainers for support.

The working installation of Office corrupted following some Office updates yesterday and after trying all sorts of repair things etc I ended up uninstalling it so I could do a fresh install.

All I'm trying to do is connect to the open Outlook application, and then send an email with an attachment, so perhaps another question to ask is, is there some new fangled way to communicate with Outlook 2016 that hasn't cropped up in my Googleathon?

Also worth noting is that my version of office is installed as a 'Windows Store Application' and therefore does not appear on the usual Add/Remove programs list, so I can't find any 'repair' options for the installation.

Thanks.

Further investigation reveals that I am doing the right thing - trying to add a COM reference to 'Microsoft Outlook 16.0 Object Library' is now the correct way to target Outlook .. https://stackoverflow.com/a/21018418/5040941.

I've checked the GAC, and the assemblies aren't registered. I've done a repair via the 'Apps and Features' right-click start menu option, and they still aren't appearing - it's as if the Windows Store apps just shove their dlls into the Program FilesWindowsApps* folder, and don't bother to register them in the GAC.

In answer to the much appreciated comments!

Using the following code

If I use the nuget Microsoft.Office.Interop.Outlook package, i get a System.Runtime.InteropServices.COMException: 'Invalid class string (Exception from HRESULT: 0x800401F3 (CO_E_CLASSSTRING))' exception.

If I try using Microsoft Outlook 15.0 Object Library or Microsoft Outlook 14.0 Object Library references via the Assemblies/Extensions tab of Add Reference, I get a System.Runtime.InteropServices.COMException: 'Invalid class string (Exception from HRESULT: 0x800401F3 (CO_E_CLASSSTRING))' exception.

I don't think accessing the WindowsApps folder is the way to go.Firstly, it's locked down for some reason which typically indicates the potential for trouble if i start digging around and changing security permissions, not to mention the fact that maintaining a copy of the latest dll in my solution will undoubtedly add unnecessary complexity to my project.

Office 365 interop

Secondly, but more importantly, if I have office installed, and I can access 'Microsoft Outlook 16.0 Object Library' from Excel Vba, then why can't I access it from Visual Studio?

There is obviously some issue with the installation not registering the dlls properly, only Excel has some trick it uses to make the reference available anyway.

Apply stamps to a PDF document in much the same way you apply a stamp on a paper document. Follow these steps in Adobe Acrobat DC to either use a series of predefined stamps or create your own stamp. /add-stamps-to-adobe-acrobat.html.

Has anyone reading this managed to install Office 365/2016 Windows Store and found a reference to 'Microsoft Outlook 16.0 Object Library' in Visual Studio?

Am I the only with this problem?! Because it affects multiple computers in my office running Windows 10 and Office 365 ..

In answer to RogerN (thanks), please see the image below - I don't have Microsoft.Office.Interop.Outlook version 16 listed, and Microsoft.Office.Core isn't listed either.

If I try to use the v15 library, I get the following error:

System.Runtime.InteropServices.COMException HResult=0x80040154 Message=Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000-C000-000000000046} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)). Source=mscorlib

*AND THE ANSWER IS *

The two computers I bought from Dell are 64 bit, but they come preinstalled with 32 bit, windows store versions of MS Office 2016/365.

In order to fix the problem, I had to:

  • uninstall the store app from Settings > Apps > Apps&Features > Microsoft Office Desktop Apps > Uninstall
  • log into portal.office.com
  • select install office apps, advanced, choosing the 64-bit version

Quite why Dell think we want 32 bit versions installed on 64 bit machines, or why someone from Microsoft hasn't posted a solution to this problem, is beyond my understanding, but nevertheless, RogerN was correct. Thanks to everyone for taking time out their days to help me out.

3-14159265358979323846264
3-141592653589793238462643-14159265358979323846264
2,5311 gold badge9 silver badges30 bronze badges

1 Answer

Elaborating on my earlier comment: From what you've described, it sounds like you've installed a 32-bit version of Microsoft Office on a 64-bit machine. Only 32-bit COM objects would have been registered, and therefore a 64-bit .NET application would be unable to find them. If you search your registry, you ought to find that the 0006F03A-0000-0000-C000-000000000046 class ID is only registered under the Wow6432Node.

To resolve the issue, you could either install the 64-bit version of Office or force your .NET application to target the x86 platform.

RogerNRogerN

Not the answer you're looking for? Browse other questions tagged c#excelvisual-studiooutlookoffice-interop or ask your own question.

Join GitHub today

GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.

Sign up New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comments

commented May 29, 2018 — with docs.microsoft.com

I may have my numbers mixed up but if Office 15.0 is Office 2013 then Office 2016 PIAs are missing from the list. Even if PIAs don't exist in Office 2016 for some reason (seems unlikely) that should be explicitly called out so the reader knows where they stand wrt Office 2016.

Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

  • ID: 88fddd73-1fac-2149-71db-5f20c8c94934
  • Version Independent ID: 46e037ee-a5fd-7274-b072-8df92ce70eda
  • Content: Office Primary Interop Assemblies - Visual Studio
  • Content Source: docs/vsto/office-primary-interop-assemblies.md
  • Service: unspecified
  • Product: visual-studio-dev15
  • GitHub Login: @TerryGLee
  • Microsoft Alias: tglee
added area - VSTO and sharepointenhancement labels May 29, 2018
self-assigned this May 29, 2018

commented May 29, 2018

@FBoyne Thanks for your feedback. I do believe you are correct in your assessment. This task is on our backlog and we will attend to it when time permits.

commented May 29, 2018

@TerryGLee Thanks but sadly I'm half right at best. The 'seems unlikely' comment is probably wrong because .NET 4 introduced the 'No PIA' feature which I think eliminated the need to ship PIAs.

Assuming I'm more right now, it would still be good if the PIA documentation explained that PIAs were no longer needed and so were no longer shipped (if in fact they are no longer shipped).

Sorry, I should have thought this all through more carefully. I got fixated on finding a certain version of a PIA.

commented May 31, 2018

@FBoyne Thanks for the update. We'll verify and then update the docs. But please be advised that this is in our backlog queue, so it won't happen right away.

commented Jun 1, 2018

No problem. I'm in the software business myself o I totally understand. 😊 I just didn't want to leave you with the mistaken idea that a 2016 PIA definitely existed.From: Terry G. LeeSent: Thursday, May 31, 2018 11:51 AMTo: MicrosoftDocs/visualstudio-docsCc: Frank Boyne; MentionSubject: Re: [MicrosoftDocs/visualstudio-docs] Full List of Primary InteropAssemblies Does Not include Office 2016? (#1056)@FBoyne Thanks for the update. We'll verify and then update the docs. But please be advised that this is in our backlog queue, so it won't happen right away.—You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub, or mute the thread.
added this to the Backlog milestone Jun 25, 2018
removed their assignment Aug 7, 2018
Microsoft
added doc-bug and removed enhancement labels Sep 19, 2018

Microsoft Office Interop Assemblies 2016 17

Closed
Closed

Microsoft Office Primary Interop Assemblies 2016

commented Mar 6, 2019

this was fixed with PR #4107

#please-close

closed this Mar 6, 2019

Microsoft Office Interop Assemblies 2016 Free

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment