View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
McManCSU[_23_] McManCSU[_23_] is offline
external usenet poster
 
Posts: 1
Default Problems returning Collection object


I get this error:
Compile error

Argument not optional

when i try to return a collection like this:

For i = 1 To assyNums.count
For j = 1 To assyNums.Item(i).getBOM.count
partnum = assyNums.Item(i).getBOM.Item(j)
occur = numOccurances(partnum)
numOccur.Add (occur)
Next j
.......

(BOMParts is an obj variable and is already initialized)
Public Function getBOM() As Collection
getBOM = BOMparts
End Function


I have tried the simple way where I make a temporary collection an
assign it to what ".getBOM()" returns but same error. Any help

--
McManCS
-----------------------------------------------------------------------
McManCSU's Profile: http://www.excelforum.com/member.php...fo&userid=2437
View this thread: http://www.excelforum.com/showthread.php?threadid=39422