0

I have not done any programming for quite some time, so apologies if this is simple. I have had a look on several forums but haven't found quite what I am looking for.

I have Microsoft Office 365 ProPlus with Excel Version 1902. The Office version was pushed centrally form IT; a click to run type deployment so I didn't have options to ensure PIAs were enabled.

I am using C# in Visual Studio Community 2017.

I am wanting to include the Microsoft.Office.Interop.Excel reference to allow me to do certain operations in Excel from within my application.

When I attempt to Add the reference to my project, under assemblies there are non of the PIAs available.

However when I look under the COM options there is the "Microsoft Excel 16.0 Object Library" available.

How do I install or enable the PIAs so that I can use these with Office 365?

LDH087
  • 1
  • 1
  • 2
    Pretty sure you can just install it from NuGet: https://www.nuget.org/packages/Microsoft.Office.Interop.Excel/ – Evan Trimboli Aug 12 '19 at 13:21
  • See following : https://learn.microsoft.com/en-us/visualstudio/vsto/office-primary-interop-assemblies?view=vs-2019 – jdweng Aug 12 '19 at 14:33
  • I am not sure whether I am doing it the correct way, but by using the Microsoft Excel 16.0 Object Library from the COM tab, I seemed to get the Microsoft.Office.Interop.Excel option under my project References in the Solution explorer. Then used the follow (in part so I didn't have to explicitly write it out each time): using Excel = Microsoft.Office.Interop.Excel; At the moment it is seeming to work and I can create and save an Excel file from within C#. Many thanks. – LDH087 Aug 12 '19 at 15:57

0 Answers0