

document.All("ctl00_ContentPlaceHolder1_btnexportar").Clickĭim InvokePattern As IUIAutomationInvokePattern Set IE = CreateObject("InternetExplorer.application") Declare PtrSafe Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Longĭeclare PtrSafe Function SetWindowText Lib "user32" Alias "SetWindowTextA" (ByVal hWnd As Long, ByVal lpString As String) As Longĭeclare PtrSafe Function SetForegroundWindow Lib "user32" (ByVal hWnd As Long) As Longĭeclare PtrSafe Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)ĭeclare PtrSafe Function SendMessageByString Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As String) As Longĭeclare PtrSafe Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Longĭeclare PtrSafe Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Longĭeclare PtrSafe Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hWnd As Long, ByVal lpString As String, ByVal cch As Long) As Longĭeclare PtrSafe Function GetWindowTextLength Lib "user32" Alias "GetWindowTextLengthA" (ByVal hWnd As Long) As Longĭeclare PtrSafe Function SetFocus Lib "user32.dll" (ByVal hWnd As Long) As Integer Also you can remove some of the declare function lines which are not required for you. You need to change the code as per your language settings. I am using this code to download the file.
