I get the error in the title above when trying to execute a VBA command to click a button on Internet Explorer 11:
Const sURL As String = "MY_URL"
Set ie = New InternetExplorerMedium
With ie
.Visible = True
.Navigate sURL
While .Busy Or .ReadyState < 4: DoEvents: Wend
.Document.getElementById("ctl00_contentPH_btnCopyTimesheet").Click '***HERE***
While .Busy Or .ReadyState < 4: DoEvents: Wend
End With
ID: ctl00_contentPH_btnCopyTimesheet
. I found that the code is working fine on my side. See test result here. So it can be possible that the button is not available with this ID causing this error. So you can check whether you are referring to the correct button or try to wait for some time before clicking the button. If the issue persists then please try to provide more info. and try to post the HTML code for that button may help to test the issue again.