How to read the -COM object returned from invoke VBA activity as a Collection?

I m trying to retrieve the cell addresses which contains a particular text. The VBA is returning a collection and the activity gets it as a COM_Object so far. But I do not understand how to convert it into a collection again. I have included an assign activity to convert it as a collection:

CType ( COMObject , collection)

But it gives a error saying it can not convert it into a collection again. So Would you please help me to read this output object?

> Function findcellFunction(ByAmount As Integer)As Collection
> 	'On Error Resume Next
>     Dim rngX As Range			
> 	Dim WS As Worksheet
> 	Dim datax As Range
> 	Dim cellAddress As Variant
> 	Dim index As Integer
> 	Dim iTotal As Integer
> 	Dim CellArray 
> 	iTotal = 0
> 	Set CellArray = New Collection
> 	'Iterate until all cell values are found
> 	For index=1 To Amount
> 		Set rngX = Worksheets("rptBOMColorPrint").Range("A1:EZ50").Find("Colour Name", lookat:=xlPart)
> 		If Not rngX Is Nothing Then
> 		MsgBox "Found at " & rngX.Address
> 		CellArray.Add rngX.Address
> 		End If
> 		Cells(rngX.Row,rngX.Column).Delete
> 		iTotal =iTotal + index
> 	Next index
> 	'shows list that has been populated with cell addresses
> 	For Each cellAddress In CellArray
> 	MsgBox "list populated " & cellAddress
> 	Range(cellAddress).Value = "Colour Name"
> 	Next
> 	Set findcellFunction= CellArray
> End Function
> 

find cell address.xaml (9.7 KB)

@ovi @badita

Hi all,
For this i did a solution, with help of uipath activities and VBA macros both.
Uipath invoke VBA activity’s output COM
_object can be converted into int32, string,boolean and double as i could experience. But it does not support any collection or custom object.
when one value of int32/string/double/boolean is passed we can convert it as we need into the same datatype again.
To return cell collection first i am checking number of cells that contains particular text is there by a small VBA macro and then doing number of iterations of the VBA macro that returns one cell address . Then i collect that cell address into a list in uipath workflow.
If some one can add some thing to this it would be very helpful.

But again it is just a solution that needed to do my work.
It does not answer the question that how to convert COM_object into a custom object.

Hey in case you didn’t see the final answer to my post with the same problem.

You can read your custom VBA class / custom object but not a collection as it is not supported.

See here: [Invoke VBA] How to read the retrieved COM__Object in UiPath? VBA Function returns custom type - #4 by zate