T.Todua
T.Todua

Reputation: 56557

How does Microsoft Office doesn't require .NET 3.5 or 4.5, while VSTO addins require them?

When building any addin (in Visual Studio) for Microsoft Office, we have to choose the target .NET FRAMEWORK. Actually, on several PCs, where I've installed MS OFFICE 2010 it required neither .NET 3.5 nor 4.5. However, while trying to install my add-in on that same PC, it requests .NET.

Is it not possible to make the addin to work like MS-OFFICE works (without requesting the .NET framework) ?

Upvotes: 3

Views: 1615

Answers (1)

Cindy Meister
Cindy Meister

Reputation: 25693

To answer the stated question:

How does Microsoft Office doesn't require .NET 3.5 or 4.5, while VSTO addins require them?

Microsoft Office is COM-based and written using C-languages (C, C+, C++, but not C#), so the .NET Framework is not required. Office pre-dates .NET by more than a decade!

If you develop an Add-in using Visual Studio .NET then it will require the version of the .NET Framework selected for the .NET project to be installed on the machine. This is the case with VSTO, for example.

Classic VB6 used to be a common tool for creating Office Add-ins. It didn't require .NET because it was a COM programming language - and that's why it wasn't maintained or updated so that its programs could run on more recent versions of Windows (64-bit). So it's fallen into disuse.

Any programming language that can leverage the IDTExtesibility2 Interface that builds the basis of Office COM Add-ins can (in theory, at least) be used to write a COM Add-in for Office. It's necessary to research and understand that Interface, as well as how the chosen programming language relates to the Windows COM environment, in order to program an Office Add-in.

Microsoft Add-ins of the type you're thinking about canNOT be developed using VBA (as has been suggested in a comment) - VBA must run in a host application and is contained in a document belonging to the host application. VBA is able to automate other Office applications, but this does not qualify as an Add-in. In most Office applications VBA can be used as an "add-in" for that application by loading the code-container document in a certain manner, making the code available to all files opened in the Office application.

Upvotes: 4

Related Questions