Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 110
Default 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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
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.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 690
Default 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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems with WorksheetFunction.Index and WorksheetFunction.Match Luke Excel Programming 4 October 14th 09 12:57 AM
Acos function Philosophaie Excel Programming 3 August 22nd 09 08:40 PM
Modified ACOS function danpt Excel Discussion (Misc queries) 4 November 3rd 08 08:17 AM
Function ACOS in Excel VBA mario Excel Programming 3 October 11th 07 05:49 PM
Acos Function No Name Excel Programming 1 June 22nd 04 10:16 PM


All times are GMT +1. The time now is 07:28 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"