View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Application.WorksheetFunction problem

Sorry, I assumed this was a worksheet function since you were using that
qualifier. Based on what Dana has said, I look and see that is is provided
by the Analysis toolpak. If you have the analysis toolpak VBA installed you
can then do

b = Application.run ("ATPVBAEN.XLA!IsEven", Range("A1"))

to demo from the immediate window:

Range("A1").Value = 4
? Application.run("ATPVBAEN.xla!IsEven",Range("A1"))
[GetMacroRegId] 'ISEVEN' <
[GetMacroRegId] 'ISEVEN' - '752746504'
True
Range("A1").Value = 3
? Application.run("ATPVBAEN.xla!IsEven",Range("A1"))
[GetMacroRegId] 'ISEVEN' <
[GetMacroRegId] 'ISEVEN' - '752746504'
False

the lines with the [] are debug statements that the developers apparently
forgot to turn off before shipping. You only see them in the immediate
window. They would not affect you code. You do see it correctly returns
true or false based on the value of Range("A1")

Using xl2003

--
Regards,
Tom Ogilvy


"Tom Ogilvy" wrote in message
...
Dim b as Boolean
b = Application.WorksheetFunction.ISEVEN(Range("A1"))


--
Regards,
Tom Ogilvy

"Gary''s Student" wrote in

message
...
I am trying to call ISEVEN() from VBA with:

Dim b as Boolean
b = Application.WorksheetFunction.ISEVEN(A1)

I am raising "Object doesn't support this Property or Method"

What is the correct syntax?
--
Gary''s Student