C# and Excel Integration COM Add‐ins

Daniel J. Duffy, Andrea Germani · 2013

This chapter gives an introduction to COM add-ins, what they are, how to create them and how to call them from Excel. A COM add-in is a COM component that implements a special interface called IDTExtensibility2 that is responsible for connecting to and disconnecting from Excel. The Excel client can call the add-in to compute some quantity or to transfer data between Excel and other applications. It is important to note that both input to and output from the add-in are realized by Excel cells and ranges which we can access from C#. The chapter discusses the IDTExtensibility2 interface and its methods OnConnection() and OnDisconnection(), Which code we need to write when creating a COM add-in, Creating a COM add-in and using the Shared add-in wizard and Using COM add-ins with Excel. The chapter discussed a complete example and introduces Excel-DNA, an open source project for C# and Excel integration.

Read the paper · More papers on PaperTik