worksheetfunction doesn't work in vba

rnl0085

Board Regular
Joined
Dec 3, 2010
Messages
69
hello

i am using an excel function called theoretical(market,instrument,price) in my excel sheets. this is working fine.

however, when i want to use it in a vba code, for example
price = worksheetfunction.theoretical(market,instrument,price)
this always gives 0 values..

theoretical() is not a standard excel function but is used via an addin..does anyone knows why it doesn't work in vba?
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
If it's not an Excel function then it does not belong to the WorksheetFunction object. You will need to call it from the addin.
 
Upvote 0
the addinfile.xla is already viewable in the developer..in one the modules of the addin teh function can be found...but how do i call it in the regular file then? addinname.function()?
 
Upvote 0
If you can set a reference to the addin file (tools-references) then yes you can call it like that; otherwise you will need to use application.Run.
 
Upvote 0
the file isn't in the tools -> reference list..but it is in the project library in the developer on the left..and some other functions that are in the xla file are just being called in the normal excel file as well..however this doesn't seem to work for all

will the application.run make the file much slower compared to calling the function directly?
 
Upvote 0
If the addin is open it will be in the references list, but it will be listed as the project name (by default it's VBAProject - if that hasn't been changed, then you can't use a reference), not the addin name.
It will probably be a little slower but not noticeably so unless you call it a lot.
 
Upvote 0

Forum statistics

Threads
1,224,566
Messages
6,179,551
Members
452,927
Latest member
rows and columns

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