Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I reference excel custom-build add-ins in VBA

Status
Not open for further replies.

christoffersonrobb

Programmer
Jul 1, 2003
4
US

I developed an add-in to be used in Excel. I can happily access all my functions in the spreadsheet. However, I need to be able to access them in VBA. How do I reference functions from my add-in in VBA code.
 
You will need to reference XL and open the addin from there I think.

Dim XL as New Excel.Application
Dim WB as Excel.workbook

set WB=XL.OpenWorkbook("C:\Addin.xls")

debug.print wb.fYourFunction(argument1,...)

I've not tested this, but it seems ok, but there will be quite a large overhead as you are effectively opening XL too. Would be better to import the code into a module in Access. Let me know how you get on.

B

----------------------------------------------
Ben O'Hara

"Where are all the stupid people from...
...And how'd they get so dumb?"
NoFX-The Decline
----------------------------------------------
 
Ben,

Thanks for your response. I forgot to mention that my add-in is .xll file and was developed in C++ . I tried your example, but XL.OpenWorkbook() property could not be found.


Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top