Forum

Excel UDF With a Tw...
 
Notifications
Clear all

Excel UDF With a Twist

2 Posts
2 Users
0 Reactions
77 Views
(@kevine)
Posts: 1
New Member
Topic starter
 

I have some spreadsheets that have a bunch of logic defined in the sheet. I want to convert this sheet to an addin and write some vba routines to create a "wrapper" for the spreadsheet. The wrapper functions that I will call from other spreadsheets will take the parameters passed in, update corresponding cells in the addin, update the calculations and then return a value back. There seems to be issues with sheet calculation in the addin - it won't calculate. 

This is actually quite powerfull if it would work as you can encapsulate behaviour for an entire worksheet that is callable from a vba function in the addin. Pass the information in - run calculations, return any number of results through vba functions that get the values of specific calculated cells.

I am wondering is there are additional excel api calls that I need to be doing to enable calculation of worksheet cells in the addin?

 
Posted : 29/07/2020 8:26 pm
(@catalinb)
Posts: 1937
Member Admin
 

Hi Kevin,

Hard to say without seeing how the functions are built.
For example, a function will not work if the function itself is supposed to change a value in a cell.

You can add Application.Volatile to your vba functions, if they are supposed to update at each recalculation.

Last, Application.CalculateFull should recalculate every open workbook, including addins.

 
Posted : 03/08/2020 2:50 am
Share: