How to know if the VBA component of Office is installed?

excel, ms-office, vba

Solution

One possibility is to check for the presence of VBE6.DLL in C:\Program Files\Common Files\Microsoft Shared\VBA\VBA6. Or poke about in the registry looking for references to that DLL or the string VBA.

Note that this location/file name might be different for Office 2010 as there are some changes in the VBA editor.

Problem

My Excel addin requires the Visual Basic for Applications option of Excel to be installed in order for it to work. I would like my install (which is written with InnoSetup) to be able to detect if VBA is installed and warn the user if it is not. How can I detect if the option is already installed?

Original source