Este fórum está sendo desativado

Depois de 9 anos, este fórum será desativado. Mas calma.... estamos migrando para uma comunidade no DISCORD. Junte-se a nós.

ENTRAR PARA DISCORD

Tópicos relacionados a códigos VBA, gravação de macros, etc.
#39771
Boa tarde, pessoal!
Estou utilizando o código abaixo para automatizar o download de um arquivo de um site, utilizando o Internet Explorer, mas estou com dificuldade no momento que aparece o popup, com as opções Abrir, Salvar e Cancelar.
Existe uma forma de apertar o botão Salvar e indicar o local que o arquivo deverá ser salvo?

Código:

Dim HTMLDoc As HTMLDocument
Dim oBrowser As InternetExplorer

Sub Login()

Dim oHTML_Element As IHTMLElement
Dim sURL As String
On Error GoTo Err_Clear
sURL = "Link"
Set oBrowser = New InternetExplorer
oBrowser.Silent = True
oBrowser.timeout = 60
oBrowser.Navigate sURL
oBrowser.Visible = True

Do
Loop Until oBrowser.ReadyState = READYSTATE_COMPLETE

Set HTMLDoc = oBrowser.Document
HTMLDoc.all.TBUser.Value = "Login"
HTMLDoc.all.TBPassword.Value = "Senha"
HTMLDoc.all.BOk.Click
HTMLDoc.all.UWTSearchxxctl0xSearchQueryResultxWCUserSearches_input.Value = "Escolha do arquivo para Download"
HTMLDoc.all.LBExcel.Click

For Each oHTML_Element In HTMLDoc.getElementsByTagName("input")
If oHTML_Element.Type = "submit" Then oHTML_Element.Click: Exit For

Next
Err_Clear:

Resume Next
End Sub

Obrigado!
long long title how many chars? lets see 123 ok more? yes 60

We have created lots of YouTube videos just so you can achieve [...]

Another post test yes yes yes or no, maybe ni? :-/

The best flat phpBB theme around. Period. Fine craftmanship and [...]

Do you need a super MOD? Well here it is. chew on this

All you need is right here. Content tag, SEO, listing, Pizza and spaghetti [...]

Lasagna on me this time ok? I got plenty of cash

this should be fantastic. but what about links,images, bbcodes etc etc? [...]

Estamos migrando para uma comunidade no Discord