Hello,
I have trouble with get Item 1, Item 2, Item 3… objects.
Inside of OLEObject there is structure as follow:
PROG
|-------Documents
||------------- Application => PROG
||------------- Count = 3
||------------- Name = “Documents”
||------------- Item 1 (OleObject)
||------------- Item 2 (OleObject)
||------------- Item 3 (OleObject)
This I can see in VB6 Locals window.
My code is as follow:
Dim PROG As New OleObject(“PROG.Application”) -> OK
PROG.Value(“Visible”) = True -> OK, PROG comes visible
Dim Document As OLEObject = get_OLEObject(PROG, “Documents”) -> OK
Dim sName As String = Document.Value(“Name”) -> give me sName = “Documents”
Dim iCount As Integer = Document.Value(“Count”) -> give me iCOunt = 3
Dim Item As OLEObject = get_OLEObject(Document, “Item 1”) -> OLEException
The last one always give me error OLEException
I tried pass Item, Item1, Item 1, Items with arrays and no success, can anybody suggest me something?
I will be very priced.
Thank you and best regards,
Krzysztof
Function get_OLEObject(Item As OLEObject, Valor As String) As OleObject
Dim v As Variant
v = Item.Value(Valor)
If v IsA OLEObject Then
Return OLEObject(v.ObjectValue)
Else
Return Nil
End If
End Function