Unable to select specific entry form on internet explorer

tpa

New Member
Joined
Mar 19, 2013
Messages
7
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

------------------------------

1629792784720.png

Excel Cell Reference attached

Bold line in code above is not working

Regards,
Tushar Awasare
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.

Forum statistics

Threads
1,224,818
Messages
6,181,152
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top