rguglielmon
Technical User
I want to create an Excel Add-In that references the Access and ADO libraries. I'd like to avoid having the user manually add these references. From the Help documentation it looks like I can use the References collection to add references by GUID. I tried to play around with this by looping thru the references collection like this:
Dim i
For i = 1 To References.Count
Debug.Print References(i).Name
Debug.Print References(i).GUID
Debug.Print "------------------------"
Next i
and like this:
Dim Ref
For Each Ref In References
Debug.Print Ref.Name
Debug.Print Ref.GUID
Debug.Print "------------------------"
Next Ref
In each case, I get an error message "You made an illegal function call" on the For statement. What am I doing wrong or not understanding?
Dim i
For i = 1 To References.Count
Debug.Print References(i).Name
Debug.Print References(i).GUID
Debug.Print "------------------------"
Next i
and like this:
Dim Ref
For Each Ref In References
Debug.Print Ref.Name
Debug.Print Ref.GUID
Debug.Print "------------------------"
Next Ref
In each case, I get an error message "You made an illegal function call" on the For statement. What am I doing wrong or not understanding?