Jens, I did try your suggestion. However it did not work.
I even tried using the full path of the add-in file.
I also tried adding it first, but then it quits at that line (see code below)
Thanks.
==========================
Public Function DoLaunch(objExcelApplication As Excel.Application) As Boolean
On Local Error GoTo DoLaunchEH
Set objExcelApplication = CreateObject(mcsExcelApplication)
With objExcelApplication
.Visible = True
.AddIns.Add FileName:="C:\Documents and
Settings\natarajs\Application Data\Microsoft\Excel\XLSTART\IPEWB_UDF1.xla" '
Path + "myUDF.xla" ---IT JUMPS THE END FUNCTION AFTER THIS LINE
.AddIns("IPEWB_UDF1").Installed = True 'AddIns("myUDF").Installed =
True
End With
End Function
"Jens Thiel" wrote:
Try something like Application.AddIns("MyUDF").Installed = true
--
http://ManagedXLL.net/
Replace MSDN with my first name when replying to my email address!
"mrvgson" wrote in message
...
Q from Excel novice
1. I created an Excel Addin (myUDF.xla) that contains my user defined
functions
and saved it in the "...Application Data\Microsoft\Excel\XLSTART"
folder so that it is automatically loaded everytime I launch Excel.
2. I then launched Excel. (it opens Book1.xls)
3. I click the "Paste Function fx" function and browse to see what User
defined functions are available.
The functions the I added in myUDF.xla show up on the list. Great...
However, when I launch Excel through automation, and then open a workbook,
and repeat step 3
my user defined functions are no longer on the list.
Please note: My addin"myUDF" is never listed in the Add-ins available even
in 2 when I launch Excel directly without automation. However, the
functions
are made available in this case.
Has anyone encountered this problem when invoking Excel through
automation?
How can I resolve this? Your help is greatly appreciated.
Thanks,
Siva
================
Here is a sample VB code that I used to test this:
Public Function DoLaunch(objExcelApplication As Excel.Application) As
Boolean
On Local Error GoTo DoLaunchEH
Set objExcelApplication = CreateObject(mcsExcelApplication)
With objExcelApplication
.Visible = True
'.AddIns
End With
DoLaunch = True
DoLaunchEH:
End Function