Skip to content
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

Access to Office.Interop from .NET Core? #402

Closed
TechiMe opened this issue Dec 20, 2016 · 8 comments
Closed

Access to Office.Interop from .NET Core? #402

TechiMe opened this issue Dec 20, 2016 · 8 comments

Comments

@TechiMe
Copy link

TechiMe commented Dec 20, 2016

Is there a plan to add Office.Interop.Excel to available namespaces in .Net Core Class Library?

@TechiMe TechiMe changed the title Office.Interop Access to Office.Interop from .NET Core? Dec 20, 2016
@TechiMe
Copy link
Author

TechiMe commented Dec 20, 2016

Just to add that that the major reason for doing this would be if it could be made available on OSX as well as Windows, thereby offering cross-platform portability of applications that interwork with Microsoft Office (externally via COM objects) on Windows and OSX.

@terrajobst
Copy link
Member

Hey @TechiMe, thanks for filing this.

I assume the question isn't about adding the Excel automation APIs to .NET Core directly but instead have a way to automate Excel from .NET Core. Is that correct?

@TechiMe
Copy link
Author

TechiMe commented Dec 21, 2016

Hi Immo, Yes, exactly!

The only way to automate Excel for Mac at present is via embedded VBA or Javascript (Office Addins), neither of which come anywhere close to the power and flexibility of the manipulation of objects in C# which is possible for Excel for Windows. So we were hoping that .Net Core might be able to fix this hole!

Many thanks.

@terrajobst
Copy link
Member

Ah, so that's an even different question.

  • First, it's about whether you can automate Office using the COM automation APIs on Windows. I've asked our interop team to see whether it's supported and if so how.
  • Secondly, the question is whether we can make that part available cross-platform. Considering that COM is a Windows technology I highly doubt that we can make this scenario work in a cross-platform fashion.

That being said, whatever mechanism JavaScript/VBA is using on Mac, we could look into supporting this for .NET Core, but I have no idea how much would be required to do so.

@TechiMe
Copy link
Author

TechiMe commented Dec 21, 2016

Well the first is definitely possible because we do it all the time, just by referencing Office.Interop.Excel.

But, in line with what you suspect I think, I have read in various places that (up until now at least, before the advent of .Net Core) it would not be possible to make this API available on the Mac because the "unix-like architecture of OSX is not compatible with COM automation".

But, exactly as you say in your final para, somehow it is being done for the JavaScript/VBA interfaces on the Mac, so if you can make "whatever THAT is" available in .NET Core, you'll be the hero of the hour!!!

@richlander
Copy link
Member

Related: #409

@richlander
Copy link
Member

We have no plans to make Office COM APIs work on Mac or Linux. If the Office team produces docs on how to do this, we'd be happy to take a look. Closing as a result.

victor-david added a commit to victor-david/restless-tools that referenced this issue Jul 6, 2020
Office package doesn't work under this configuration, but directly referencing the COM does. dotnet/core#402
@kikaragyozov
Copy link

kikaragyozov commented Nov 23, 2020

I'm confused - isn't Interop currently supported for all three platforms? Windows is certainly supported right now in .NET Core for Office interops? I just tried opening an excel file and writing something to it and it worked with no hassles.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants