La mejor manera de detectar si se ha instalado VBA es el uso de la API MsiQueryFeatureState y pedir instalador de Windows si la función está instalado o no. A continuación se muestra un ejemplo de código que hace esto en VB.NET; sin embargo, puede codificar esto en cualquier idioma que le permita llamar a los componentes COM (lo siento, no estoy familiarizado con InnoSetup).
Private Declare Function MsiQueryFeatureState Lib "Msi" Alias "MsiQueryFeatureStateA" (ByVal Product As String, ByVal Feature As String) As Long
Public Function FVbaAvailable() As Boolean
Dim objExcelApp As Object
Dim strProductCode As String
Dim nState As Long
Dim fAvailable As Boolean = False
Try
' Start an Excel instance and get the product code.
objExcelApp = CreateObject("Excel.Application")
strProductCode = DirectCast(objExcelApp.ProductCode, String)
' Get FeatureState for the VBAFiles Feature.
nState = MsiQueryFeatureState(strProductCode, "VBAFiles")
If (nState = 1) OrElse (nState = 3) OrElse (nState = 4) Then
' VBA is available.
fAvailable = True
End If
' Clean up.
objExcelApp.Quit()
Runtime.InteropServices.Marshal.FinalReleaseComObject(objExcelApp)
objExcelApp = Nothing
Catch ex As Exception
Trace.WriteLine(ex.Message)
End Try
Return fAvailable
End Function
Esto no funciona para Office 365, desafortunadamente. –