Interprocess Communication between Excel & C# Application?

后端 未结 2 1172
感动是毒
感动是毒 2021-01-22 07:04

I was wondering if there was a way to set up communication between an instance of excel and a C# Application. For instance, when a cell value changes, I would like to send the u

相关标签:
2条回答
  • 2021-01-22 07:19

    You need the Office Primary Interop Assemblies, which are a .Net wrapper for the COM API exposed by MS Office. You can consume events through these, so you might be able to set up a listener that will capture the event that you want.

    0 讨论(0)
  • 2021-01-22 07:24

    You can use the Visual Studio Tools for Office (VSTO) project types available in Visual Studio to automate Office from C# code. This ensures you use only managed code and do not rely on COM or the Primary Interop Assemblies being available/installed.

    This is the preferred approach when compared to the COM solution. For further information and examples, please take a look at the MSDN page.

    0 讨论(0)
提交回复
热议问题