Hello Experts,
I have a macro which load tax paying web site on internet explorer, waits up to fully load the site then fill the form with details in excel cells. all required field are properly updated. but while updating bank name and payment mode, it selects Net Banking and Bank which i want, Name of bank appears in the specific field. But when I submit the form after captcha system says Bank account not selected.
please guide how to solve the issue
-------------------------
Code is as follows
'General Declarations, or put in Module and make Public
Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Private Const SW_MAXIMIZE = 3
Sub TDS_Challan_281()
Dim IE As Object
Dim Name, TAN, Tal, Dist, State, Pin, Mob As String
Dim WS As ThisWorkbook
Dim Dt As Worksheet
'Range("A1").Interior.Color = RGB(WorksheetFunction.RandBetween(0, 255), WorksheetFunction.RandBetween(0, 255), WorksheetFunction.RandBetween(0, 255))
'Range("A1").Font.Color = RGB(WorksheetFunction.RandBetween(0, 255), WorksheetFunction.RandBetween(0, 255), WorksheetFunction.RandBetween(0, 255))
Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True
ShowWindow IE.hwnd, SW_MAXIMIZE
IE.navigate "https://onlineservices.tin.egov-nsdl.com/etaxnew/tdsnontds.jsp"
Do While IE.Busy
Application.Wait DateAdd("S", 1, Now)
Loop
Set doc = IE.document
doc.getElementsByClassName("btn btn-info b-align")(0).Click
Do While IE.Busy
Application.Wait DateAdd("S", 1, Now)
Loop
doc.getElementById("0021").Checked = True
doc.getElementById("200").Click
'Payment Type........
doc.getElementsByName("NaturePayment")(1).Value = ("94C - Payment of contractors and sub-contractors")
'Bank................
doc.getElementsByName("NetBankName_c")(0).selectedIndex = 18 ' Bank
'TAN.................
doc.getElementsByName("TAN")(1).Value = Workbooks("Challan.xlsm").Sheets("Data").Range("C4")
'Assessment Year.....
doc.getElementsByName("AssessYear")(1).selectedIndex = 1
'Name................
doc.getElementsByName("Add_Line2")(1).Value = Workbooks("Challan.xlsm").Sheets("Data").Range("C5")
'Gram................
doc.getElementsByName("Add_Line3")(1).Value = "Grampanchayat"
'Taluka..............
doc.getElementsByName("Add_Line4")(1).Value = Workbooks("Challan.xlsm").Sheets("Data").Range("C6")
'District............
doc.getElementsByName("Add_Line5")(1).Value = "Satara"
'State...............
doc.getElementsByName("Add_State")(1).selectedIndex = 21
'Pincode.............
doc.getElementsByName("Add_PIN")(1).Value = Workbooks("Challan.xlsm").Sheets("Data").Range("C7")
'Mobile Number.......
doc.getElementsByName("Add_MOBILE")(0).Value = Workbooks("Challan.xlsm").Sheets("Data").Range("C8")
doc.getElementsByName("captchaText")(0).Select
Application.SendKeys ("{CAPSLOCK}")
Application.SendKeys ("{NUMLOCK}")
ActiveWorkbook.Save
End Sub
------------------------------
Excel Cell Reference attached
Bold line in code above is not working
Regards,
Tushar Awasare
I have a macro which load tax paying web site on internet explorer, waits up to fully load the site then fill the form with details in excel cells. all required field are properly updated. but while updating bank name and payment mode, it selects Net Banking and Bank which i want, Name of bank appears in the specific field. But when I submit the form after captcha system says Bank account not selected.
please guide how to solve the issue
-------------------------
Code is as follows
'General Declarations, or put in Module and make Public
Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Private Const SW_MAXIMIZE = 3
Sub TDS_Challan_281()
Dim IE As Object
Dim Name, TAN, Tal, Dist, State, Pin, Mob As String
Dim WS As ThisWorkbook
Dim Dt As Worksheet
'Range("A1").Interior.Color = RGB(WorksheetFunction.RandBetween(0, 255), WorksheetFunction.RandBetween(0, 255), WorksheetFunction.RandBetween(0, 255))
'Range("A1").Font.Color = RGB(WorksheetFunction.RandBetween(0, 255), WorksheetFunction.RandBetween(0, 255), WorksheetFunction.RandBetween(0, 255))
Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True
ShowWindow IE.hwnd, SW_MAXIMIZE
IE.navigate "https://onlineservices.tin.egov-nsdl.com/etaxnew/tdsnontds.jsp"
Do While IE.Busy
Application.Wait DateAdd("S", 1, Now)
Loop
Set doc = IE.document
doc.getElementsByClassName("btn btn-info b-align")(0).Click
Do While IE.Busy
Application.Wait DateAdd("S", 1, Now)
Loop
doc.getElementById("0021").Checked = True
doc.getElementById("200").Click
'Payment Type........
doc.getElementsByName("NaturePayment")(1).Value = ("94C - Payment of contractors and sub-contractors")
'Bank................
doc.getElementsByName("NetBankName_c")(0).selectedIndex = 18 ' Bank
'TAN.................
doc.getElementsByName("TAN")(1).Value = Workbooks("Challan.xlsm").Sheets("Data").Range("C4")
'Assessment Year.....
doc.getElementsByName("AssessYear")(1).selectedIndex = 1
'Name................
doc.getElementsByName("Add_Line2")(1).Value = Workbooks("Challan.xlsm").Sheets("Data").Range("C5")
'Gram................
doc.getElementsByName("Add_Line3")(1).Value = "Grampanchayat"
'Taluka..............
doc.getElementsByName("Add_Line4")(1).Value = Workbooks("Challan.xlsm").Sheets("Data").Range("C6")
'District............
doc.getElementsByName("Add_Line5")(1).Value = "Satara"
'State...............
doc.getElementsByName("Add_State")(1).selectedIndex = 21
'Pincode.............
doc.getElementsByName("Add_PIN")(1).Value = Workbooks("Challan.xlsm").Sheets("Data").Range("C7")
'Mobile Number.......
doc.getElementsByName("Add_MOBILE")(0).Value = Workbooks("Challan.xlsm").Sheets("Data").Range("C8")
doc.getElementsByName("captchaText")(0).Select
Application.SendKeys ("{CAPSLOCK}")
Application.SendKeys ("{NUMLOCK}")
ActiveWorkbook.Save
End Sub
------------------------------
Excel Cell Reference attached
Bold line in code above is not working
Regards,
Tushar Awasare