• 0
Sign in to follow this  
LeandroLazari

PROBLEMA COM SENDKEYS NO VBA

Question

Boa tarde, 

Estou tentando fazer o download deste link "https://agentes.ons.org.br/download/operacao/hidrologia/arquivoMLTENAS_201709.pdf"

Como a página é vazia e não tem desenvolvedor F12, eu tentei por SendKeys. Mas eu quando executo o código, a página abre e fecha mas não faz o download. Por que? E tem alguma outra forma de fazer este download? 

segue o código:


    Sub ENA_ONS()
    
    Dim ie As Object
    
    Set ie = CreateObject("InternetExplorer.Application")
    
    ie.Navigate "https://agentes.ons.org.br/download/operacao/hidrologia/arquivoMLTENAS_201709.pdf"
    ie.Visible = True
    
        Do Until (ie.readyState = 4 And Not ie.Busy)
            DoEvents
        Loop
        
    Application.SendKeys "%{S}"
    
    ie.Quit
    
    End Sub

Share this post


Link to post
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this