Compilation Error 424 
Author Message
 Compilation Error 424

When compiling the following proc, why do I get an "Error 424:
Object needed" ?

Thanx for any help.

Private Sub MyButton_Click()
    Dim x As Integer

    Set x = 3
End Sub

--
________________________________________________________________________
 Christoph Keller
 Department of Veterinary Surgery - University of Zurich
 Winterthurerstrasse 260 - CH-8057 Zurich - Switzerland
 Phone ++41 79 414 83 04  /  Fax ++41 1 313 03 84

--
________________________________________________________________________
 Christoph Keller
 Department of Veterinary Surgery - University of Zurich
 Winterthurerstrasse 260 - CH-8057 Zurich - Switzerland
 Phone ++41 79 414 83 04  /  Fax ++41 1 313 03 84



Sun, 03 Aug 2003 18:23:45 GMT  
 Compilation Error 424

Quote:
>Private Sub MyButton_Click()
>    Dim x As Integer

>    Set x = 3
>End Sub

Since Integer isn't an object (yet) in VBA 6, you don't need the
"Set" statment. Simply use

x=3

  -- Dev



Sun, 03 Aug 2003 20:45:13 GMT  
 Compilation Error 424
Because your using Set on an Integer. You only need to use set on an Object,
like a recordset e.g. To get your code working, simply remove the word Set.

i.e.
Private Sub MyButton_Click()
    Dim x As Integer

    x = 3
End Sub

Hope this helps

Tony Oakley

Quote:

> When compiling the following proc, why do I get an "Error 424:
> Object needed" ?

> Thanx for any help.

> Private Sub MyButton_Click()
>     Dim x As Integer

>     Set x = 3
> End Sub

> --
> ________________________________________________________________________
>  Christoph Keller
>  Department of Veterinary Surgery - University of Zurich
>  Winterthurerstrasse 260 - CH-8057 Zurich - Switzerland
>  Phone ++41 79 414 83 04  /  Fax ++41 1 313 03 84

> --
> ________________________________________________________________________
>  Christoph Keller
>  Department of Veterinary Surgery - University of Zurich
>  Winterthurerstrasse 260 - CH-8057 Zurich - Switzerland
>  Phone ++41 79 414 83 04  /  Fax ++41 1 313 03 84



Sun, 03 Aug 2003 21:00:42 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Automation error... Error 424, Object Required

2. Very newbie problem with Object Error (Error 424)

3. Error Starting application executable (error 424 - Object required)

4. run-time error 424 object required

5. Run-time error '424': Object required

6. Runtime error 424: Object required

7. Error 424 Object Required

8. Run-Time error '424': object Required

9. Clipboard.Clear - Returns Error 424 - Object Required

10. Error 424 from Outlook to Word

11. Runtime Error 424 Missing Object

12. Run-Time Error 424, Object-Required.

 

 
Powered by phpBB® Forum Software