Hi,

Blow code works fine when using F8 key clik step by step, but run key doesn't. what i need to add below code? Please watch youtube link below to better understand question.
Thanks for advance.

https://youtu.be/zxL5GlhG0iA

Private Sub CommandButton1_Click()
  Dim ie As Object
   Dim objelement As Object
   Dim c As Integer
   Dim i
   Dim strCaptcha As String
   Dim strImageSource As String
   Dim img As HTMLHtmlElement 'Tools=>Reference=>Micrsoft Html Object Library
   
   Set ie = CreateObject("InternetExplorer.Application")
   
   With ie
      .Visible = True
      .navigate "https://website url here#"
      
      'wait until first page loads
      Do Until .readystate = 4
         DoEvents
      Loop
   
      On Error Resume Next
   i = 112
    '  For i = 1 To ie.document.all.Length
         If ie.document.all.Item(i).innertext = "ФНС (гос. пошлина)" Then
         ie.document.all.Item(i).Click
         
         'wait until interactive page loads - NB NOTE READY STATE NUMBR = 3
'         Do Until .readystate = 3
'            DoEvents
'         Loop
     '    Exit For
         End If
    '  Next i
   End With
   
   'populate fields
   With ie.document
      'text boxes
      
      .all("fio").Value = "Alex"
      .all("contact").Value = "9117057773"
      .all("payer_address").Value = "Canada st N"
      .all("inn_from").Value = "771562265931"
      .all("inn").Value = "7726062105"
      .all("account").Value = "45914000"
      .all("purpose").Value = "Payment"
      .all("comment").Value = "02.04.2016"
      .all("sum").Value = "1000"
      .all("get_total_sum").Click
      '.all("now_pay").Click
      
   End With
 
   Set ie = Nothing
End Sub