Approaches to Working with .NET
There are three main approaches to using .NET with Excel. You can use .NET to create:
- Components that can be used from Excel macros
This approach works with all Excel versions and is much the same as creating COM components for use with Excel using earlier versions of Visual Basic. The .NET tools automatically generate the type libraries needed to use .NET objects from COM applications such as Excel.
- Standalone applications that use Excel as a component
This approach works best with Excel XP and 2003, since those versions provide the files needed to use Excel from .NET applications smoothly. In this scenario, the user starts a standalone application to create or modify Excel wo rkbooks.
- Workbook-based applications that run all of their code as .NET
This approach works for Excel 2003 and later. In this scenario, the user opens the workbook, which automatically loads the .NET assembly containing the application code. The workbook contains a link to this assembly, so the workbook file (.xls) can be distributed to many different users and locations, while the assembly (.dll) resides in a single location (for example at a network address).
From the user’s standpoint, the main differences between these approaches are how you start the application and what versions of Excel are supported. From a developer’s standpoint, the differences affect how you develop, debug, and deploy the applications. Even the development tools you need vary somewhat between these ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access