Software Archive
Read-only legacy content
17060 Discussions

COM addin for Excel

wfroese
Beginner
865 Views
Has anyone ever made a COM addin for Excel in Office 2000? I made a COM dll and I could use it from VB so that checked out ok. I then made registry changes to identify that this is an addin for Excel. That didn't seem to work so I then followed the instructions to add the COM addin item to my menus and tried browsing to it but that didn't work either. Has anyone had success with this? I'd really like to add a formula to Excel without using VBA and an addin workbook (XLA) in the middle.
0 Kudos
3 Replies
Intel_C_Intel
Employee
865 Views
I haven't created COM add-ins for Office 2000 (still stuck in the world of Office 97), but I've done one for Visual Studio. The first question that comes to mind is did you implement the IDTExtensiblity2 interface? There's a number of MSDN articles which may be of some help. A quick search can find them. The articles are typically written for VB programmers, but they can still be of help in figuring out what to do. (I went down a similar path when I wrote my VS add-in in C++)

hth,
John
0 Kudos
wfroese
Beginner
865 Views
Ah... the IDTExtensiblity2 interface. Thanks! I forgot all about it. With a bit of luck I should be able to do this and then post a shell of something that will let others go and add Excel functions.
0 Kudos
wfroese
Beginner
865 Views
After trying a bit I've decided that I don't know how to implement an interface for IDTExtensiblity2. What I do know is MSADDNDR.tlb is the type library for it. Does anyone have any hints? Do I use the Fortran COM Server Wizard to add an Interface manually to my Class? Would you then use the OLE/COM object viewer to read it and copy the information into the wizard? I see this:

[
uuid(B65AD801-ABAF-11D0-BB8B-00A0C90F2744),
hidden,
dual
]
dispinterface _IDTExtensibility2 {
properties:
methods:
[id(0x00000001)]
void OnConnection(
[in] IDispatch* Application,
[in] ext_ConnectMode ConnectMode,
[in] IDispatch* AddInInst,
[in] SAFEARRAY(VARIANT)* custom);
[id(0x00000002)]
void OnDisconnection(
[in] ext_DisconnectMode RemoveMode,
[in] SAFEARRAY(VARIANT)* custom);
[id(0x00000003)]
void OnAddInsUpdate([in] SAFEARRAY(VARIANT)* custom);
[id(0x00000004)]
void OnStartupComplete([in] SAFEARRAY(VARIANT)* custom);
[id(0x00000005)]
void OnBeginShutdown([in] SAFEARRAY(VARIANT)* custom);
};

It looks like important stuff but I don't know what to do with it. Any thoughts?
0 Kudos
Reply