title: Finding a button in IE11 (IUIAutomationElement)
body: <p>I have been trying to use exactly the code given in the link below but I cannot get it to work with IE 11.</p>
  
  <p><a href="https://stackoverflow.com/questions/26038165/automate-saveas-dialouge-for-ie9-vba">Automate saveas dialouge for IE9 (vba)</a></p>
  
  <p>Copying the code for convenience:</p>
  
  <pre><code>Option Explicit
  Dim ie As InternetExplorer
  Dim h As LongPtr
  Private Declare PtrSafe Function FindWindowEx Lib "user32" _ 
    Alias "FindWindowExA" (ByVal hWnd1 As LongPtr, _
    ByVal hWnd2 As LongPtr, ByVal lpsz1 As String, _
    ByVal lpsz2 As String) As LongPtr
  
  Sub Download()
    Dim o As IUIAutomation
    Dim e As IUIAutomationElement
    Set o = New CUIAutomation
    h = ie.Hwnd
    h = FindWindowEx(h, 0, "Frame Notification Bar", vbNullString)
    If h = 0 Then Exit Sub
  
    Set e = o.ElementFromHandle(ByVal h)
    Dim iCnd As IUIAutomationCondition
    Set iCnd = o.CreatePropertyCondition(UIA_NamePropertyId, "Save")
  
    Dim Button As IUIAutomationElement
    Set Button = e.FindFirst(TreeScope_Subtree, iCnd)
    Dim InvokePattern As IUIAutomationInvokePattern
    Set InvokePattern = Button.GetCurrentPattern(UIA_InvokePatternId)
    InvokePattern.Invoke
  End Sub   
  </code></pre>
  
  <p>The button is not found, meaning after executing</p>
  
  <pre><code>Set Button = e.FindFirst(TreeScope_Subtree, iCnd)
  </code></pre>
  
  <p>Button is still 'nothing'. Is IE11 any different from IE9 in this respect? Should I change "PropertyCondition" to something else or am I doing something wrong here? Thank you.</p>