Excel Add-In

L

Leo

Hello All. I was wondering if someone can help me with an issue I am having
with add-ins. I have custom add-ins that I amusing for excel, but they are
not sitting in the add-ins folder. If I open excel direclty the add-ins are
loaded no problem, but when I use a program to fire up excel, the add-in
doesn't appear and the reference is broken. Does anyone know of a way to
have excel load the add-ins automatically when opened from another program?
It would be of trmendous help

Thanks in advance

leo
 
J

James Cox

Leo - not sure if this is your exact case, but if you mean that you are
using something like the following (where sOpen is the pathname of your
Excel file)

Dim xlApp As Excel.Application
Dim xlBook As Excel.Workbook

Set xlApp = CreateObject("Excel.Application")
Set xlBook = xlApp.Workbooks.Open(Filename:=sOpen)

then you can use

xlApp.Addins("EmployeeFastLookup").Installed = True

to "register" your addin. Note that at least one source recommended testing
to see if the addins were installed and if so, removing them (i.e.,
..Installed = False) and then installing them - I'm not sure why this was
suggested.

Also note that if your addin is really a .xll file, you will need to use
something like

xlApp.RegisterXLL "c:\program files\killerApp\killerApp.xll"

instead of the .Addins code.

Hope this helps!


James Cox
 
T

Tom Ogilvy

xlApp.Addins("EmployeeFastLookup").Installed = True

will test if the addin is checked under tools=>Addins. It won't load the
addin.

Also, when excel is started through automation, addins are not loaded to
save time. You must load them overtly.


This was suggested yesterday by KeepItCool and should work:

code from KeepItCool (Oct 21, 2004)
Sub LoadXLwithAddins()
Dim xl As Object
Dim ai As Object

Set xl = CreateObject("Excel.Application")

For Each ai In Application.AddIns
If ai.Installed Then
xl.Workbooks.Open(ai.FullName).RunAutoMacros 1
End If
Next

xl.Visible = True
Set xl = Nothing
End Sub
 
L

Leo

thanks a lot guys


Tom Ogilvy said:
xlApp.Addins("EmployeeFastLookup").Installed = True

will test if the addin is checked under tools=>Addins. It won't load the
addin.

Also, when excel is started through automation, addins are not loaded to
save time. You must load them overtly.


This was suggested yesterday by KeepItCool and should work:

code from KeepItCool (Oct 21, 2004)
Sub LoadXLwithAddins()
Dim xl As Object
Dim ai As Object

Set xl = CreateObject("Excel.Application")

For Each ai In Application.AddIns
If ai.Installed Then
xl.Workbooks.Open(ai.FullName).RunAutoMacros 1
End If
Next

xl.Visible = True
Set xl = Nothing
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top