Acos function

P

Philosophaie

I am trying to use the Acos function in my code:

y = Application.WorksheetFunction.Acos(x)

but it keeps giving me an error:

"Unable to get the Acos property of the WorksheetFunction class."
 
G

Gary''s Student

Sub dural()
Dim x As Double
x = 0.1
MsgBox (Application.WorksheetFunction.Acos(x))
End Sub


Seems to work. Have you declared x to be double in your code??
 
G

Gord Dibben

What do you get when you run this?

x = 0.1
y = Application.WorksheetFunction.Acos(x)
MsgBox y


Gord Dibben MS Excel MVP
 
R

Ron Rosenfeld

I am trying to use the Acos function in my code:

y = Application.WorksheetFunction.Acos(x)

but it keeps giving me an error:

"Unable to get the Acos property of the WorksheetFunction class."

What is your value for "x"?

If it is not in the range of possibility (i.e. -1 to 1) you will see that error
message.
--ron
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top