Forum Discussion
dnemescu
Apr 30, 2023Copper Contributor
Norm.S.Dist in VBA Access
hello, I am trying to use Norm.S.Dist in a VBA module, ms access, in a querry. i found only very old hints, that are not working anymore. could you help me with a fast, working example? this c...
JoeUser2004
Apr 30, 2023Bronze Contributor
dnemescu wrote: ``MyNorm2 = xlFunc.Norm_S_Dist(x, True)``
I don't know about MSAccess, but the Excel Worksheetfunction Norm_S_Dist has only one parameter, just like the Excel NORMSDIST function.
So perhaps the following is sufficient:
Public Function MyNorm2(x As Double) As Double
Dim xlApp As Object
Set xlApp = CreateObject("Excel.Application")
MyNorm2 = xlApp.WorksheetFunction.Norm_S_Dist(x)
xlApp.Quit
Set xlApp = Nothing ' not necessary for a local variable?
End Function