excel functions in queries

P

Peter Hafner

Hi there,

I want to call the excel function median and quartile from within a
query. I tried following VBA code:

Function med(ByVal FirstArg As Double, ParamArray OtherArgs()) As Double
excel.WorksheetFunction.Median (FirstArg)
End Function

Sub test()
MsgBox (med(12, 1, 88, 12))
End Sub

This gives me always a 0 as result. What is wrong?

Thanks,
Peter
 
Top