User Defined Functions in an Add-in

ElvisSteel

Board Regular
Joined
Mar 23, 2009
Messages
122
I have setup an add-in containing several of my commonly used User Defined Functions. When I use one of these functions in a workbook with the add-in loaded, I just get #NAME? unless I specify the Add-in name explicitly prior to the function,
e.g. =Addin.xla!FunctionName(params...)

When I press enter, this works OK, but the in-cell formula shows...
=FunctionName(params...), the Addin bit has disappeared.
If I re-edit this cell, F2+Enter, the #NAME? error reappears.

Can anyone advise what I am doing wrong?
I am using Excel 2003 with Windows XP.

Thanks
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Speculation: Does the name conflict with an Excel function/some other type of reserved name?
 
Upvote 0
Hi and thanks for your help on this, the functions were called "CalcRtn", "CalcFormula" and "CalcRating" - I am fairly sure that not all of these can be reserved names!
Anyway, I renamed the functions in the add-in (to CalcReturn, CalcScore and CalcRate) and then changed the formulae in the worksheet and it worked straight away. The only thing I can think is that the problem was caused because I originally cut the functions out of the worksheet macro, and pasted them into the add-in without changing the worksheet formulae. Maybe the worksheet couldn't resolve this.
All seems OK now, and I have since added a few more and each time created the function before entering the formula into the worksheet and all is OK.
Thanks again for taking the time to help
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

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
Back
Top