Trouble with Add-In

chrisk0420

New Member
Joined
May 5, 2011
Messages
6
I have a UDF that is stored as an Add-in.

Here is the code:

Code:
[FONT=Courier][COLOR=#00007f]Option [/COLOR][COLOR=#00007f]Explicit[/COLOR][/FONT]
 
[FONT=Courier][COLOR=#00007f]Function[/COLOR] TEST(returns [COLOR=#00007f]As[/COLOR] Range, [COLOR=#00007f]Optional[/COLOR] pr_Year [COLOR=#00007f]As[/COLOR] [COLOR=#00007f]Double[/COLOR] = 1)[/FONT]
 
[FONT=Courier]TEST = (Evaluate("=PRODUCT(1+" & returns.Address & "/100)") ^ (pr_Year / (returns.Rows.Count + returns.Columns.Count - 1)) - 1) * 100[/FONT]
 
[FONT=Courier][COLOR=#00007f]End[/COLOR] [COLOR=#00007f]Function[/COLOR][/FONT]

I have this UDF saved as an Add-In. It works fine in a workbook with one worksheet. With multiple worksheets it still calculates fine while the workbook is open, but once I close and reopen it the only worksheet that calculates correctly is the one I was in when I saved it. The rest of the sheets don't calculate until I manually recalculate each cell with the formula.

If I store the UDF in the workbook itself it works fine with multiple worksheets. The problem is only when I store it as an Add-In.

I researched and tried many different options and none seem to work.

Does anyone have advice as to why this may not be working or can point me in the right direction as to where I might be able to find the answer?

Thanks in advance for your help.
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.

Forum statistics

Threads
1,224,586
Messages
6,179,730
Members
452,939
Latest member
WCrawford

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