View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Adrian[_7_] Adrian[_7_] is offline
external usenet poster
 
Posts: 29
Default Function unable to return Collection object

Hi,

Here is a small segment of my code :
"
Sub SeedOPErrs()

Dim a As Collection
a = rFunction() ' <----VBA editor returns an error "Argument not
optional"
' when I attempt to run SeedOPErrs

End Sub

Function rFunction() As Collection

Dim a As New Collection
a.Add "GT"

rFunction = a

End Function

"

What is wrong with the code above ? Why is there an error "Argument not
optional" ??!! I stared at my screen for hours ...and i still cannot figure
out !!
Thanks in advance !!!

Regards,
Adrian