Problem Set InvokePattern = Button.GetCurrentPattern (UIA_InvokePatternId)

1

I'm having trouble with the save button in IE11 - I changed the field to the language of the program (Portuguese), but then I'm not getting it.

Sub DownloadFile(h As Long)
Dim o As IUIAutomation
Dim e As IUIAutomationElement
Dim iCnd As IUIAutomationCondition
Dim Button As IUIAutomationElement
Dim InvokePattern As IUIAutomationInvokePattern

Set o = New CUIAutomation
h = FindWindowEx(h, 0, "Frame Notification Bar", vbNullString)
If h = 0 Then Exit Sub

Set e = o.ElementFromHandle(ByVal h)
Set iCnd = o.CreatePropertyCondition(UIA_NamePropertyId, "Salvar")
Set Button = e.FindFirst(TreeScope_Subtree, iCnd)
*Set InvokePattern = Button.GetCurrentPattern(UIA_InvokePatternId)*
InvokePattern.Invoke
End Sub

The error you are giving:

  

Run-time error '91': Object variable or with block variable not set

    
asked by anonymous 22.05.2018 / 16:36

0 answers