ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Acos in WorksheetFunction (https://www.excelbanter.com/excel-programming/436408-acos-worksheetfunction.html)

Philosophaie

Acos in WorksheetFunction
 
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.

Dana DeLouis[_3_]

Acos in WorksheetFunction
 
Hi.

n = WorksheetFunction.Acos(z/m)

If z/m=Pi/2 or z/m=3*P/2 Then
Msgbox("N/A")
Else... whatever...


Note that for a Real solution, z/m should be in the Range -1 to +1.
So numbers near Pi/2 and 3 Pi/2 would return complex numbers.
= = = = = = =
Dana DeLouis



On 11/19/09 8:45 PM, Philosophaie wrote:
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


Rick Rothstein

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.




All times are GMT +1. The time now is 12:48 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com