Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have two code modules, one named "Primary" and the other is "Utils".
'The "Utils" module has the following subroutine: '----------------------------------------------- Public Sub Foo (a as Integer, b as Integer) MsgBox "Nothing here." End Sub ' The "Primary module has the following subroutine: '------------------------------------------------- Public Sub Goo() Dim x, y as Integer x = 2 y = 3 Utils.foo x, y ' ByRef argument error here End Sub When you run the Goo() subroutine, you get the "ByRef argument type mismatch". What's wrong here? -Robert |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
RG III wrote in :
I have two code modules, one named "Primary" and the other is "Utils". 'The "Utils" module has the following subroutine: '----------------------------------------------- Public Sub Foo (a as Integer, b as Integer) MsgBox "Nothing here." End Sub ' The "Primary module has the following subroutine: '------------------------------------------------- Public Sub Goo() Dim x, y as Integer x = 2 y = 3 Utils.foo x, y ' ByRef argument error here End Sub When you run the Goo() subroutine, you get the "ByRef argument type mismatch". What's wrong here? 'x' isn't (necessarily) an Integer, it's a Variant (unless there's a Deftype statement somewhere). You have to specify each variable's type to change it from the default: Dim x as Integer, y as Integer -- He felt emptied, a shell without emotions. Everything he touched brought death and grief. And it was like a disease that could spread across the universe. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
ByRef argument type mismatch (repost) | Excel Programming | |||
ByRef Argument Type Mismatch | Excel Programming | |||
ByRef Argument Type mismatch | Excel Programming | |||
ByRef argument type mismatch when passing dictionary object | Excel Programming | |||
ByRef argument type mismatch error? | Excel Programming |