This is how I got MsiReinstallFeatureA & MsiGetProductInfo to work in VB
Many Thank to Robert Dickau for his help.
(General)
Private Declare Function MsiReinstallFeatureA Lib "msi.dll" (ByVal szProduct As String, ByVal szFeature As String, ByVal dwReinstallMode As Long) As Long
Private Declare Function MsiGetProductInfo Lib "msi.dll" Alias "MsiGetProductInfoA" (ByVal szProduct As String, ByVal szAttribute As String, ByVal lpValueBuf As Long, ByRef pcchValueBuf As Long) As Integer
Const ERROR_SUCCESS = 0
Const ERROR_SUCCESS_REBOOT_INITIATED = 1641
Const ERROR_SUCCESS_REBOOT_REQUIRED = 3010
Dim datalen As Long
Dim ValName As String
Dim retval As Long
Private Sub Form_Load()
Call ReinstallFeature("{90110409-6000-11D3-8CFE-0150048383C9}","EXCELFiles")
End Sub
Public Function ReinstallFeature(sGUID as String,sFeatureName as String)
retval = MsiReinstallFeatureA(sGUID, sFeatureName,REINSTALLMODE_USERDATA)
Select Case retval
'Report only successful feature reinstallations
Case ERROR_SUCCESS, ERROR_SUCCESS_REBOOT_INITIATED, ERROR_SUCCESS_REBOOT_REQUIRED
MsiGetProductInfo aInstall(x, 0), "InstalledProductName", StrPtr(ValName), datalen
ValName = StrConv(Left(ValName, datalen), vbUnicode, datalen)
MsgBox ValName & " feature " & sFeatureName & " has been successfully reinstalled"
Case Else
' perform some type of error handling
End Select
End Function