Sub Image_into_Excelby_Ajit_Yadav()
On Error Resume Next
Dim myshell As Shell32.Shell, ReadCommand, CaptchaCode, i
Set myshell = New Shell32.Shell
For i = 1 To 5 ' Change it
ReadCommand = "tesseract.exe " & "'C:\Users\Kumar Ajit\Downloads\All Images\Image " & i & ".png'" & " " & "'C:\Users\Kumar Ajit\Downloads\All Images\READ\Image " & i & "'" & " ' -l eng'"
myshell.ShellExecute "powershell", vArgs:=ReadCommand, vShow:=0
Application.Wait (Now + TimeValue("00:00:05"))
Open "C:\Users\Kumar Ajit\Downloads\All Images\READ\Image " & i & ".txt" For Input As #1
Line Input #1, CaptchaCode
Close #1
Application.Wait (Now + TimeValue("00:00:02"))
MyCaptchaCode = Application.WorksheetFunction.Substitute(CaptchaCode, Chr(10), "")
Cells(i + 1, 2).Value = Trim(Application.WorksheetFunction.Clean(MyCaptchaCode))
Cells(i + 1, 1).Value = "Sr. " & i
Next i
End Sub