Accessing the functions inside an add-in?

A

Air_Cooled_Nut

I've created an add-in. I would like to make the functions in it available
to other VBA programmers. I figure the programmer would need to Reference
the add-in. What can I do to my add-in code that would allow its functions
to be accessed by outside modules? My add-in is not contained in a Class
module...does that matter?
 
A

Air_Cooled_Nut

Nevermind, I figured it out.
--- Code Start ---
Sub test()
Dim dummy As String 'My function does return a value

dummy = Application.Run("SAP_Data_Assistant.SAP_ReturnDataPath", _
"C:\Excel\OTS\SAP OPOS Output File.xls", "",
Sheets("Where").Range("A2").Value, False)

Sheets(1).Range("A1").Value = dummy
End Sub
--- Code End ---
My add-in is named "SAP_Data_Assistant.xla" and the function I want to use
is "SAP_ReturnDataPath" (it has a parameter list but that's not important
here).

Basically it's:
Application.Run ("add-in name.function"[, paramater1][,parameter2][,etc.])

For simple functions:
Application.Run "add-in name.function"

Suggestions for a better way are welcomed :)
 

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