Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem using Worksheet Functions???

Status
Not open for further replies.

ejc00

MIS
Jul 22, 2001
114
US
I need to do natural log (LN) and Correlation (Correl) calculations in Access... however, when i try to use them in queries the way i use functions like Sum, i get the error message: "Undefined function 'LN' in expression."

in Access help, these functions are listed as Worksheet functions. is there any way to enable these in Access (2000)? or is there an easy way to calculate these?

thanks,
evan
 
As best I can tell, those function are not allowed in Access. You might try simply linking to the worksheet and perform your calcs in the excel worksheet. The link is dynamic.
 
thanks for the tip...

through an excel newsgroup, i've figured out my dilemma somewhat... here is the code i'm using:


Public Function Corr(x As Range, y As Range)

Dim xl As Excel.Application
Set xl = CreateObject("Excel.Application")

Corr = xl.Correl(x, y)

xl.Quit ' Very important.
Set xl = Nothing

End Function


where "Correl" is my Excel function. the invocation of the function is working correctly, it's my range that isn't working out exactly as planned.

thanks again,
ejc
 
did you add the reference to the excel library to your app?

MOST of the Excel procedures are available, the ones with "range" arguments need arrays to be placed in the arg position.

MichaelRed
m.red@att.net

There is never time to do it right but there is always time to do it over
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top