Hi,
I am new to macros. I am writing my first code to fill some fields in web page and save it. The page is having few tabs, on clicking the tabs fields will be displayed on some part of same page for the corresponding tabs, where i am trying to fill the data.
Below is the html code for one of the tab
<a id="TabRequirementst" class="greyRoundbtn active"?
<span class="bRt">
<span class="bMid">Requirements</span>
<span>
</a>
And below is the html code for one of the field under above tab
<input class="enhanced" id="systemcontrol_0_TextBox" name="systemcontrol[0].TextBox" type="text value tabindex="110">
I have written below code to click the tab and enter the text in the field under that tab, but getting "error 424: Object required" at the tab ".click" code line.
IE.document.getelementbyid("TabRequirementst").click
IE.document.getelementbyid("systemcontrol_0_TextBox").value ="enter text here"
and changed the code like below, this time getting error "Object not found" at "enter text here" code line
<code style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; vertical-align: baseline; white-space: inherit;">Dim e as Object
For Each e In ie.document.getElementsByTagName("span")
If e.InnerText = "Requirements" Then
e.Click
Exit For
End If
Next
IE.document.getelementbyid("systemcontrol_0_TextBox").value ="enter text here"</code>
If i debug the code step by step it is working fine for both the codes. But if i run the code it is not working
Can someone help me with the steps if i miss anything.
Thanks!
I am new to macros. I am writing my first code to fill some fields in web page and save it. The page is having few tabs, on clicking the tabs fields will be displayed on some part of same page for the corresponding tabs, where i am trying to fill the data.
Below is the html code for one of the tab
<a id="TabRequirementst" class="greyRoundbtn active"?
<span class="bRt">
<span class="bMid">Requirements</span>
<span>
</a>
And below is the html code for one of the field under above tab
<input class="enhanced" id="systemcontrol_0_TextBox" name="systemcontrol[0].TextBox" type="text value tabindex="110">
I have written below code to click the tab and enter the text in the field under that tab, but getting "error 424: Object required" at the tab ".click" code line.
IE.document.getelementbyid("TabRequirementst").click
IE.document.getelementbyid("systemcontrol_0_TextBox").value ="enter text here"
and changed the code like below, this time getting error "Object not found" at "enter text here" code line
<code style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; vertical-align: baseline; white-space: inherit;">Dim e as Object
For Each e In ie.document.getElementsByTagName("span")
If e.InnerText = "Requirements" Then
e.Click
Exit For
End If
Next
IE.document.getelementbyid("systemcontrol_0_TextBox").value ="enter text here"</code>
If i debug the code step by step it is working fine for both the codes. But if i run the code it is not working
Can someone help me with the steps if i miss anything.
Thanks!