M
MrJingles
Guest
I've created an object, it reads Excel data .....
So that is working fine...........
The problem is I want to know if I use the collection properly
===============================================
===============================================
Public Function getCustomerIds() As Collection
Dim c As New Collection
Dim counter as integer
Dim v As Variant
For Each v In obj_Excel.Worksheets(excelsheet).Range(excelcustomerrangeid)
x.Add Item:=v, key:=counter
counter = counter+1
Next
getCustomerIds = x <-- Error 449 : Argument not optional
End Function
==============================================
The part where I call the function:
Dim c As New Collection
Dim oo_Excel A New objExcel
===============================================
===============================================
c = oo_Excel.getCustomerIds() //this will call the function and raise the error 449 does anybody know how this works ??????? I cant find it
So that is working fine...........
The problem is I want to know if I use the collection properly
===============================================
===============================================
Public Function getCustomerIds() As Collection
Dim c As New Collection
Dim counter as integer
Dim v As Variant
For Each v In obj_Excel.Worksheets(excelsheet).Range(excelcustomerrangeid)
x.Add Item:=v, key:=counter
counter = counter+1
Next
getCustomerIds = x <-- Error 449 : Argument not optional
End Function
==============================================
The part where I call the function:
Dim c As New Collection
Dim oo_Excel A New objExcel
===============================================
===============================================
c = oo_Excel.getCustomerIds() //this will call the function and raise the error 449 does anybody know how this works ??????? I cant find it