I am trying to automate a download from a webpage, and it requires that i klik a button to access a login form.
I have searched the web and various threads for answers, with some luck, but now I get the error:
'Object doesnt support this property or method'.
The HTML part for the button i want to click is:
<button name="idpEndpointId" type="submit" value="https://saml.nemlog-in.dk" class="btn btn-primary">Vælg</button>
Any suggestions?
Private Sub download()
Dim IE As Object
Dim document As Object
Dim nemKnap As Object
'Create IE object
Set IE = CreateObject("InternetExplorer.Application")
'Show browser
IE.Visible = True
'Navigate to URL
IE.Navigate "https://link.com/"
'Statusbar if waittime
Application.StatusBar = "Page is loading."
'Wait
'Application.Wait Now + TimeValue("00:00:02")
' First attempt on tabbing through the website to press enter
' SendKeys "{TAB}"
' SendKeys "{TAB}"
' SendKeys "{TAB}"
' SendKeys "{TAB}"
' SendKeys "{TAB}"
' SendKeys "{TAB}"
' SendKeys "{TAB}"
'Do
'Loop While IE.busy
Do
Loop Until IE.readystate = 3
Do
Loop Until IE.readystate = 4
Set nemKnap = IE.document.getElementsByValue("https://saml.nemlog-in.dk")
'nemKnap.Click // is supposed to happen afterwards
End Sub
type="submit"made me think it was in a web form. Does the button name change? have you triedgetElementByID?