0
Dim xyzWkB As Excel.workbook
Set xyzWkB = setGetxyzObj(reportFile.Text)
populateListCombo (xyzWkB)

The function is defined as follows:

Public Function populateListCombo(activeWkB As Excel.workbook)
......
......
End Function

But in execution at the time of calling populateListCombo am getting the error "object does not support this property"

Here setGetxyzObj is defined as follows:

Public Function setGetxyzObj(Optional userInput As String) As Excel.workbook
    Static xyz As New Excel.Application
    Static xyzWkB As Excel.workbook
    Set xyz = New Excel.Application
    If Not (userInput = "") Then
        Set xyzWkB = xyz.Workbooks.Open(userInput)
    End If
    Set setGetxyzObj = xyzWkB
End Function

I have also tried with populateListCombo (setGetxyzObj()), but still getting the same error.

GSerg
  • 76,472
  • 17
  • 159
  • 346
Arijit Roy
  • 379
  • 3
  • 14
  • possible duplicate of [VBA Adding a class to a collection](http://stackoverflow.com/questions/6331106/vba-adding-a-class-to-a-collection) – GSerg Oct 26 '14 at 22:14
  • 1
    Did you try to call `populateListCombo` withou *any* parentheses? In Vb6 you should generally not use them when calling methods (as opposed to functions) – Dabblernl Oct 26 '14 at 22:34
  • calling populateListCombo without parentheses also did not work. – Arijit Roy Oct 27 '14 at 20:10

0 Answers0