View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.programming
[email protected] aaronfude@gmail.com is offline
external usenet poster
 
Posts: 26
Default Order of Excel Add-ins.


Charles Williams wrote:
Assuming you really do have an Automation addin rather than some

other kind
of addin:

Basically, my c# add-in does not know that the VBA add-in exists.


Of course not, but its so easy: all it has to do is open it as if it

was a
workbook ...

****** The VBA addin checks whether the c# add-in is loaded - and

loads
it programmatically, if necessary.


something like this (not tested), where Myprojectname.classname is

the
ProgId of your Automation addin

dim oAddin as addin

on error resume next
set oaddin=nothing
set oaddin=addins("MyProjectname.classname")
on error goto 0
if oaddin is nothing then
addins.add("MyProjectname.classname")
set oaddin=addins("MyProjectname.classname")
endif

if not oaddin.installed then oaddin.installed=true


Thank you, Charles!!! This code works!

Could you explain some of the terminology? Assume that my automation
add-in is registered.

Am I correct that in order for (set
oaddin=addins("MyProjectname.classname")) to work it must already be in
the list of Add-ins but not necessarily "clicked in"?

And that "oaddin.installed=true" is equivalent to "clicking it in"?


And as a final question. If my automation add-in is clicked to be
loaded when Excel starts, but my VBA add-in with your wonderful code
beats Excel to the punch, will Excel try to load it afterwards anyway
and if so will it cause an error?

Once again, thank you so much.

Aaron Fude



Charles
______________________
Decision Models
FastExcel 2.1 now available
www.DecisionModels.com