View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Mat P:son[_2_] Mat P:son[_2_] is offline
external usenet poster
 
Posts: 97
Default Automatically registering ADD-IN COM DLL - Some help required.

Hi there Julio,

I might be a bit confused, because I'm currently not using a COM Add-In, but
a normal VBA, but shouldn't the add-in be immediately available to Excel
after entering the appropriate info into the Windows Registry?

You need to use the Add-In Manager dialogue for XLA files (unfortunately)
but I thought one of the good things about COM add-in:s is the ability to
circumvent this?

Anyway, some references from MSDN; hope it helps:

http://support.microsoft.com/?kbid=238228

Later,
/MP

"rhodinar" wrote:


Hi guys,

I've developped a COM ADD-IN in VB6 and it's working perfectly!
When the DLL is registered, the complement starts but the public
functions to be used inside the excel cells aren't shown in the
functions box. All the other things, such forms and routines works
well.

In order to show the functions I've to manually include de class via
Tools-Add-Ins-Automation-mydll.class

Doing that the functions are shown in the list in his own category.

Now the problem ... I don't want any manual interaction with the user.
I need to install the Add-In completly transparent for the final user,
and this include the functions.

I've tried to put the complement using this code .....

Dim oXL As Object, oAddin As Object
Set oXL = CreateObject("Excel.Application")
oXL.Workbooks.Add
Set oAddin = oXL.AddIns.Add( ... Path to my DLL ... , False )
oAddin.Installed = True
oXL.Quit
Set oXL = Nothing

.... but it crash with a 1004 error. Unable to get the Add property of
the AddIns class.
I've read this error comes if no workbook open, but this is not the
case. It only happens when I
call a DLL, if the code it's changed to refer a .xla file, it works
perfecty well.

Now, i'm driving me mad .....

Any help would be appreciated. Someone has solved this issue ???
Thanks in advance,
Julio

PD: If any needs more details, don't hesitate to contact me!