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.