Reference functions in different VBAproject

fboehlandt

Active Member
Joined
Sep 9, 2008
Messages
334
Hi there,
quick question regarding custom functions in VBA. I have an add-in containing several functions that I would like to use in my current VBA project. The add-in has a unique name so I should be able to refer to it. How do I go about doing that? Thankx
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).

xld

Banned
Joined
Feb 8, 2003
Messages
5,378
Set a reference to the add-in in your other project, then just call the functions.
 

fboehlandt

Active Member
Joined
Sep 9, 2008
Messages
334
thanks for the reponse,
that is what I did but no luck there. Here my steps to retrace:
- open the module in my current project (simply named VBAproject) containing the function reference
- Go to Tools, References and then select the relevant project from the scrolldown menu. The project has a unique name VBAMatrix (the bracketed term and name of the actual add-in when using Excel is macro.xla)
- rerun the macro
Again, VBA does not recognize the function reference, although the reference appears directly underneath the module. I assume that one should be able to refer to the function as one would to any other in the same project(i.e. without the application.worksheetfunction prefix). If it helps:
- the functions are recognized in Excel
- the add-in opens automatically whenever I start Excel (hence it is never inactive)
- The relevant function is defined in an Option Private Module
Any ideas please?
 

Watch MrExcel Video

Forum statistics

Threads
1,133,274
Messages
5,657,780
Members
418,413
Latest member
Radoslaw Poprawski

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top