On Error Resume Next
Set objShell = CreateObject("WScript.Shell")
strPlugin = '"""C:\Moodys\CDOROM.xll""" 'This is the name of your Excel Addin
strExcelRegistryKey = "HKCU\Software\Microsoft\Office\11.0\Excel\Options" 'Becareful of your Office version here!
intCount = 0
intCompleted = 0
If objShell.RegRead(strExcelRegistryKey & "\Open") = "" Then
objShell.RegWrite strExcelRegistryKey & "\Open", strPlugin, "REG_SZ"
intCompleted = 1
End If
If intCompleted <> 1 Then
Err.Clear
Do Until Err.number = -2147024894
intCount = intCount + 1
strRegKey = strExcelRegistryKey & "\Open" & intCount
strRegKeyValue = objShell.RegRead(strRegKey)
Loop
objShell.RegWrite strExcelRegistryKey & "\Open" & intCount, strPlugin, "REG_SZ"
End If
Set objShell = Nothing
No comments:
Post a Comment