Calling Addin function?

N

Norman Harker

Hi Brian!

If you set a reference to it you can call it just like the function is
in the subject workbook.

Tools > References
Check against your Addin.
--
Regards
Norman Harker MVP (Excel)
Sydney, Australia
[email protected]
Excel and Word Function Lists (Classifications, Syntax and Arguments)
available free to good homes.
 
D

Dave Peterson

Just to add to Norman's post:

that Reference is under the Tools menu in the VBE (not excel itself).

And you'll want to change the name of the XLA's project (from the default
VBAProject).

While in the VBE, hit ctrl-R to show the project explorer. Then click on the
VBAProject (YourAddinName.XLA)

and hit F4 and rename the project in the (Name) box.

===
An alternative that you could use without setting a reference is to use
application.run.

Option Explicit
Sub testme()
Dim tempLong As Long
tempLong = Application.Run("personal.xla!myfunction", Range("a1:a10"))
End Sub

would be one example
 
Top