Public Function RetrieveCollection() As Collection 
Dim objCustomUtil As Object 
Set objCustomUtil = CreateObject("Customer.Class") 
Set RetrieveCollection = objCustomUtil.RetrieveCollection 
End Function

解决方案 »

  1.   

    可能还需要释放Public Function RetrieveCollection() As Collection 
    Dim objCustomUtil As Object 
    Set objCustomUtil = CreateObject("Customer.Class") 
    Set RetrieveCollection = objCustomUtil.RetrieveCollection 
    Set objCustomUtil = Nothing
    End Function
      

  2.   

    Public Function RetrieveCollection() As Collection 
    Dim objCustomUtil As Object 
    Set objCustomUtil = CreateObject("Customer.Class") 
    Call RetrieveCollection.add(ObjCustomUtil.RetrieveCollection,StrKey)End Function
      

  3.   

    Public Function RetrieveCollection() As Collection 
    Dim objCustomUtil As Object 
    Dim objCustomUtilCH As Object 'ObjCustomUtil.RetrieveCollection 中的元素Set objCustomUtil = CreateObject("Customer.Class") 
    For Each objCustomUtilCHIn ObjCustomUtil.RetrieveCollection
        Call RetrieveCollection.addObjCustomUtil.RetrieveCollection,StrKey)
        NextEnd Function
      

  4.   

    ganzhiruogy(方竹) 为何作此解释??
    当时老外并没说在哪个环境下,在VB6里 zmcpu(你不帮我谁帮我?)的做法是必须的,不过在VB7里不需要加 Set