View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein Rick Rothstein is offline
external usenet poster
 
Posts: 5,934
Default Acos in WorksheetFunction

Try it without the "Function." part...

n = WorksheetFunction.Acos(z/m)

You also do not need to specify the Application object in your first line...

Pi = WorksheetFunction.Pi

--
Rick (MVP - Excel)


"Philosophaie" wrote in message
...
Program:

Pi=Application.WorksheetFunction.Pi
If z/m=Pi/2 or z/m=3*P/2 Then
Msgbox("N/A")
Else
n = Function.WorksheetFunction.Acos(z/m)
End If

Error code:

Run-time Error '1004':
Unable to get the Acos property of the WorksheetFunction.