Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Error: 424 Object required

Hi

Can anybody explain the following to me

I have a com dll with a class Object that has a function setParam.
When I call from VBA

Object.setParam(X) gives me Error: 424 Object required

But
Object.setParam X
and
call Object.setParam(X)

both work

and if X is a Double instead of some object the first call above works

I'd really like to understand what is the issue. (Even if I have the fix)

Thanks in advance
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Error: 424 Object required

Because that is the syntax of VBE. You don't put the arguments in
parentheses unless you use the call. If you do, then the argument is
evaluated before it is passed - in your case, you are returning the default
value of X as the argument to SetParam so your object gets dereferenced or
it can't be evaluated perhaps. If X is a double, then it is evaluated, but
that doesn't change what X is - so no problem in that case.

--
Regards,
Tom Ogilvy

"DavidM" wrote in message
om...
Hi

Can anybody explain the following to me

I have a com dll with a class Object that has a function setParam.
When I call from VBA

Object.setParam(X) gives me Error: 424 Object required

But
Object.setParam X
and
call Object.setParam(X)

both work

and if X is a Double instead of some object the first call above works

I'd really like to understand what is the issue. (Even if I have the fix)

Thanks in advance



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
Error 424 - Object Required [email protected] Excel Programming 2 December 30th 04 03:38 PM
424 Object required error J_J Excel Programming 4 November 7th 04 05:34 AM
Object Required Error Steph[_3_] Excel Programming 3 August 13th 04 03:26 PM
Syntax Error Runtime Error '424' Object Required sjenks183 Excel Programming 1 January 23rd 04 09:25 AM
error 424 - Object Required blb Excel Programming 0 October 1st 03 05:32 PM


All times are GMT +1. The time now is 03:35 PM.

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"