Skip to main content

Posts

Showing posts from December, 2019

VBA uiautomationcore.dll to save internet explorer download

Copy file  C:\Windows\System32\UIAutomationCore.dll  file to users Documents i.e  C:\Users\admin\Documents  then add reference  UIAutomationClient  to your macro file. Paste below code in your module: 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