How to fix a "TargetInvocationException" problem

Aug 2, 2011 at 12:15 AM
Edited Aug 2, 2011 at 12:16 AM

A few people have installed NodeXL and then attempted to use it, only to be stopped in their tracks by an ugly error message that includes this inscrutable text:

"System.Reflection.TargetInvocationException: Uncaught exception thrown by method called through Reflection. (Exception from HRESULT: 0x80131604)." 

This problem occurs when you have something called ".NET Programmability Support" disabled in Excel.  It is normally enabled when Office is installed, but if it gets turned off for some reason, NodeXL (which is a .NET program) won't be able to run.  Enabling .NET Programmability Support will fix the problem.

To enable .NET Programmability Support in Excel, follow these steps:

1. Go to Control Panel, Add or Remove Programs (Windows XP) or Programs and Features (Vista, Windows 7).

2. Select Microsoft Office.  The exact name will vary with the Office version you have; it might be Microsoft Office Home and Student 2010, for example.

3. Select Change.

4. In the Office setup wizard, select Add or Remove Features and click Continue.

5. Expand Microsoft Office, Microsoft Office Excel.

6. For .NET Programmability Support, select Run from My Computer.

7 Click Continue.

When the Office setup wizard completes (it takes a while), you should be able to use NodeXL.

-- Tony