Thread: type mismatch?
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default type mismatch?

try

public sub myFunc(a as string, b as string, _
optional c as integer, optional d as Object)


--
Regards,
Tom Ogilvy




"Gixxer_J_97" wrote in message
...
hi all!

i have a sub defined in a module:
public sub myFunc(a as string, b as string, optional c as integer,

optional
d as label)
....
end sub

calling this from a userform:

call myFunc(a,b,c,d)

where
a and b are TextBox (defined in the UserForm)
c is an integer defined private c as integer
d is a Label (defined in the userform)

all variables have a value

i am getting a type mismatch error on this call
call myFunc(a,b,c,d)
.... why?
(i have also tried a.value, a.text, cstr(a) and that hasn't worked. i've
also tried cint(c)