View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
JP Ronse JP Ronse is offline
external usenet poster
 
Posts: 174
Default application.worksheetfunction

Hi Jim,

Tnx for the clarification. Can I conclude that both syntaxes are equal,
except of course from the returned error, but decision depends who the
programmer will handle errors?

Any idea which is the fastest way? AFAIK, calling the application or
accessing objects is slow compared e.g. accessing a memory variable. If you
have a lot of errors to process, the VBA way can be much faster then the
application way or do I see this wrong?


Wkr,

JP


"Jim Cone" wrote in message
...
The type of error returned is different.

"Application" returns a Variant containing an error which allows the use
of IsError...
If IsError(Application.Match...)

"WorksheetFunction" returns a VBA error which requires an error handler...
On Error Resume Next
Application.WorksheetFunction.Match...
If Err.Number < 0 then
--
Jim Cone
Portland, Oregon USA



"JP Ronse"
wrote in message
...
Hi All,
I see that most of the MVP's are using:
x = application.worksheetfunction.<function(arguments)

while

x = application.<function(arguments)
is also working.
Is there a reason to use worksheetfunction, except that the syntax of the
function is given?
Wkr,
JP