Ranjitha Nagendra
Posts: 40
Joined: 2015-10-26
|
Hi team,
I have a problem similar to what has been discussed under: https://www.add-in-express.com/forum/read.php?FID=5&TID=10691
I have an XLL UDF that takes in a parameter marked as AcceptAsArray = false, I need that in order to get the parameter as a Range object in my code.
now, due to the fact that when marking a parameter with AcceptAsArray = false it immediately causes the function to become volatile, I've applied the trick [Module.CallWorksheetFunction((ADXExcelWorksheetFunction)237, false);], this works great; the function doesn't get called every time there's a calculation not affecting the aforementioned parameter.
I use Excel's function VLOOKUP in the parameter (e.g. =MyFunction($D6:$AB$6)) - Here each cell from $D6 to $AB$6 have VLOOKUP formula.
My VLOOKUP formula is like this : =VLOOKUP(E$5,Sheet2!$A:$C,2,FALSE)
Now, my problem is, I change the value in E$5, But the input what MyFunction gets is not the new changed value, but old value. Once MyFunction calculation is done ( with old value ofcourse) , E$5 gets the new changed value. So I am thinking, is MyFunction calculating before E$5 has got the new value?
How to overcome this?
Is Excel's sequence of calculation is not how I want?
I did not get it fixed, even after making MyFunction volatile as well, with : Module.CallWorksheetFunction((ADXExcelWorksheetFunction)237, true);
Please adviseRanjitha |
|
Andrei Smolin
Add-in Express team
Posts: 18829
Joined: 2006-05-11
|
|