How to call a VSTO AddIn method from a separate C# project?

前端 未结 4 2078
情深已故
情深已故 2020-12-10 07:14

I have a C# Excel Add-in project \"MyExcelAddIn\" that has a public method Foo() to do something complex. For testing purposes, the add-in also defines a toolbar button whic

4条回答
  •  [愿得一人]
    2020-12-10 07:37

    If you're building an application-level add-in, I believe this may be your answer: MSDN VSTO Article

    It involves two steps: (From the article)

    1. In your add-in, expose an object to other solutions.
    2. In another solution, access the object exposed by your add-in, and call members of the object.

    The other solution may be: (Again from the article)

    • Any solution that is running in a different process than your add-in (these types of solutions are also named out-of-process clients). These include applications that automate an Office application, such as a Windows Forms or console application, and add-ins that are loaded in a different process.

提交回复
热议问题