Question : Submit Information from Excel Form to Webpage

Hi Experts,

In the attached file, there is a sheet named ITNS281, which contains the information relating to online tax payment to be made. The site address https://onlineservices.tin.nsdl.com/etaxnew/tdsnontds.jsp contains a link to the Form ITNS281, which is to be filled in and submitted for online tax payment. Presently all the fields are filled manually and then we need to click "Proceed" button at the bottom to proceed to the next screen. I have marked some fields in Blue which corresponding field number in the Web Form. E.g.,
1st field relates to Opting between Company and Non Company deductees (Marked 1)
2nd Field relate to Tax Deduction Account Number (Marked 2 in the Sheet)
.
and so on.

The attached file does open the above site when we click "Submit" on the Excel Sheet ITNS 281, but I don't know how to proceed therefrom and how the information is to be filled into the relating fields automatically.

There is lot of help on the web, but doesn't know which one is useful except this one http://www.sourcecodester.com/forum/copy-paste-excel-web-browser-text-box.html, but even here don't know how to make use of it.

Note : I have marked the field number for easy reference. It would be nice if the above fields can be referred to in some other way. I can keep the required data in single column and use it from there if that can be of any convenience for this purpose.

Regards
Kanwaljit

Answer : Submit Information from Excel Form to Webpage

I have done done some combos so I have demoed them in assessyear and Add_State as in the snippet.

Chris
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
Sub AutomateCHALLAN1()
Dim ws As Worksheet
Dim IE As Object
Dim frmTax As Object
Dim doc As Object
Dim opt As Object
Dim ws1 As Worksheet
Dim drop As Integer
 
    Set ws = Worksheets("ITNS 281")
    Set ws1 = Worksheets("ReqFieldValue")
    Set IE = CreateObject("InternetExplorer.application")
    IE.Visible = True
    IE.Navigate ("https://onlineservices.tin.nsdl.com/etaxnew/tdsnontds.jsp")
 
    Do While IE.Busy: DoEvents: Loop
    Do While IE.ReadyState <> 4: DoEvents: Loop
 
    Set doc = IE.Document
 
    Set ctl = doc.getElementById("281")
 
    ctl.FireEvent ("onclick")
 
    Set doc = IE.Document
 
    Do While IE.Busy: DoEvents: Loop
    Do While IE.ReadyState <> 4: DoEvents: Loop
 
    Set frmTax = doc.forms(1)
 
    Set opt = frmTax.Item("MajorHead")
 
    Select Case ws.Range("W1")
        Case 1
            opt.Item(1).Checked = True
        Case 2
            opt.Item(0).Checked = True
    End Select
    
    frmTax.Item("TAN").Value = ws1.Range("D3").Value
    frmTax.Item("Name").Value = ws1.Range("D4").Value
    For drop = 0 To frmTax.Item("AssessYear").Length - 1
        frmTax.Item("AssessYear").Options.selectedindex = drop
        If LCase(frmTax.Item("AssessYear").Options(drop).FirstChild.Data) = ws1.Range("D5").Value Then
            Exit For
        End If
    Next
    frmTax.Item("Add_Line1").Value = ws1.Range("D6").Value
    frmTax.Item("Add_Line2").Value = ws1.Range("D7").Value
    frmTax.Item("Add_Line3").Value = ws1.Range("D8").Value
    frmTax.Item("Add_Line4").Value = ws1.Range("D9").Value
    frmTax.Item("Add_Line5").Value = ws1.Range("D10").Value
    For drop = 0 To frmTax.Item("Add_State").Length - 1
        frmTax.Item("Add_State").Options.selectedindex = drop
        If LCase(frmTax.Item("Add_State").Options(drop).FirstChild.Data) = LCase(ws1.Range("D11").Value) Then
            Exit For
        End If
    Next
    frmTax.Item("Add_PIN").Value = ws1.Range("D12").Value
    
    'IE.Quit
 
End Sub
Random Solutions  
 
programming4us programming4us