View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Cone Jim Cone is offline
external usenet poster
 
Posts: 3,290
Default Problems returning Collection object

M,

It is difficult to understand what you are trying to do.
Please show your variable declarations and describe
what the code is supposed to do.

Jim Cone
San Francisco, USA


"McManCSU"

wrote in message
...

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 and
assign it to what ".getBOM()" returns but same error. Any help?


--
McManCSU
------------------------------------------------------------------------
McManCSU's Profile: http://www.excelforum.com/member.php...o&userid=24379
View this thread: http://www.excelforum.com/showthread...hreadid=394222