Calling Excel functions from a VB 2008 XLL

Add-in Express™ Support Service
That's what is more important than anything else

Calling Excel functions from a VB 2008 XLL
 
Josh W




Posts: 17
Joined: 2008-10-21
I am creating XLL UDF's in VB 2008. Is it possible to call Excel worksheet functions in VB2008?

For example, if you wanted to use normsdist in VBA you use "=worksheetfunction.normsdist()". Also, I know it is possible as well in VB6 COM add-ins. Is it possible to make similar calls in VB2008 XLLs? I tried several things but can't seem to make it work.

Thanks.

Posted 27 Oct, 2008 15:30:18 Top
Eugene Astafiev


Guest


Hello Josh,

You can use the following function:

Module.CallWorksheetFunction
Posted 28 Oct, 2008 16:13:27 Top
Josh W




Posts: 17
Joined: 2008-10-21
THanks very much! I used (using the example above),

returnVal=XLLModule.CurrentInstance.CallWorksheetFunction(AddinExpress.MSO.ADXExcelWorkseetFunction.Normsdist, Val)

and that seemed to work.

Thanks.
Posted 29 Oct, 2008 15:33:47 Top
Eugene Astafiev


Guest



You are welcome, Josh.
Posted 29 Oct, 2008 16:23:19 Top