Boas,
Estou a tentar fazer uma macro para fazer login no site da segurança social, o código que estou a usar é este, no entanto abre o site mas nao preenche os campos de username e password.
Sub FazerLoginSite()
Dim IE As Object
Set IE = CreateObject("InternetExplorer.application")
With IE
.Visible = True
.Navigate "app.seg-social.pt/sso/login?service=https%3A%2F%2Fapp.seg-social.pt%2Fptss%2Fcaslogin"
While .Busy Or .ReadyState <> 4: DoEvents: Wend
.Document.getElementById("username").Focus
.Document.getElementById("username").Value = "username"
.Document.getElementById("password").Focus
.Document.getElementById("password").Value = "password"
.Document.All("sbmtLogin").Click
While .Busy Or .ReadyState <> 4: DoEvents: Wend
Debug.Print .LocationURL
End With
End Sub