Chapter 25. Programming Excel with .NET

Visual Basic .NET is Microsoft’s next generation of the Basic language. The name change marks another milestone in the evolution of Basic: BASICA, QuickBasic, Visual Basic, and Visual Basic .NET each mark distinct changes in underlying technology. This latest change marks the graduation from the Windows Common Object Model (COM) in Visual Basic to the .NET Framework in Visual Basic .NET.

Warning

.NET is a Windows technology. It is not supported on the Macintosh.

The .NET Framework solves a lot of the shortcomings in COM—it has a more complete security model; provides a well-organized library of objects for working with HTTP, XML, SOAP, encryption, and other things; is fundamentally object-oriented; protects against memory leaks and corruption; promotes self-describing code—gosh, I’m starting to sound like a commercial. In short, .NET is the future for programming Windows.

Now the bad news: Excel is (and probably always will be) a COM application. This means that you have to take special steps if you want to use .NET components from Excel or if you want to program Excel from Visual Basic .NET.

But back to the good news: Microsoft provides many tools for making the transition between COM and .NET as easy as possible. In this chapter, you will learn how to use those tools both to take advantage of .NET from Excel and vice versa.

Tip

Code used in this chapter and additional samples are available in ch25.xls.

Get Programming Excel with VBA and .NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.