开发者

How do I enable an Excel Automation Add-in through the registry?

开发者 https://www.devze.com 2023-03-12 14:42 出处:网络
I have an Excel Automation Add-in that is registered with COM by my installer.By registering with COM, my add-in appears in the (for Excel 2007) Excel Options > Add-Ins > Manage Excel Add-Ins Go... >

I have an Excel Automation Add-in that is registered with COM by my installer. By registering with COM, my add-in appears in the (for Excel 2007) Excel Options > Add-Ins > Manage Excel Add-Ins Go... > Automation list. The users must still navigate to the dialog above and select my add-in to enable it.

Is it possible (via a registry key perhaps) to enable my automaton add-in programmatically in my installer class (or in VBA) after the types are registered with COM?

Thanks开发者_Go百科 in advance - Frank


Ive not done ths specifically, but a reference that I use has this to say regarding your question:

Automation Add-Ins are loaded in the same way as normal .xla Add-Ins , but using the ProgID instead of the file name, as in the following code:

Sub installAutomationAddIn()
    AddIns.Add Filename:="Excel2007ProgRef.Simple"
    AddIns("Excel2007ProgRef.Simple").Installed = True
End Sub

If you are creating an installation routinefor your Add-In, you may want to write directly to the registry in order to set the Automation Add-In as installed. To do so, you need to create the following registry entry (Which will already exist if you've used the above code).

(In the Registry Key:)
HKEY_CURRENT_USER\SOftware\Microsoft\Office\12.0\Excel\Options

(Create the string value:)
Name = the first unused item in the series: Open, Open1, Open2, etc.
Value = /A "Excel2007ProgRef.Simple"
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号