Need help with Internet Form Fill !!!

23izkool

New Member
Joined
Mar 4, 2011
Messages
19
Hi all,
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
I have been at this problem for close to a year and finally got some headway but stuck at the last leg. Appreciate that someone can help me with this!
<o:p></o:p>

OBJECTIVE OF THE MACRO (BASICALLY INTERNET FORM FILLING)<o:p></o:p>
  • Open up multiple websites through the multiple weblinks recorded in a spreadsheet<o:p></o:p>
  • Click the relevant buttons & copy some numerical figures from the spreadsheet into the websites, then click on the submit button in the websites to upload the figures<o:p></o:p>
<o:p></o:p>

PROBLEMS<o:p></o:p>
  • Unable to write the macro to upload figures from the spreadsheet<o:p></o:p>
    • The fields to fill belong to ‘hidden input’ type<o:p></o:p>
    • Unable to access it like what was done for clicking edit button & submit button<o:p></o:p>
  • Currently used an alternative à use ‘sendkeys method’ to (1) tab through the other fields in the website, (2) copy figures from the spreadsheet, (3) paste into the empty field which was tabbed to<o:p></o:p>
    • However, sendkeys are very unstable & sometimes tab to the wrong field!<o:p></o:p>
<o:p></o:p>
Will give more elaboration below!<o:p></o:p>
<o:p></o:p>
<o:p></o:p>
ACTUAL WEB LAYOUT<o:p></o:p>
<o:p></o:p>
<o:p> </o:p>
(Fig 1 / Before clicking ‘Edit’ Button)
http://www.host-images.com/u/files/v3nhjikndkdj5zzvysi2_thumb.jpg
<?xml:namespace prefix = v ns = "urn:schemas-microsoft-com:vml" /><v:group id=_x0000_s1026 style="WIDTH: 450pt; HEIGHT: 305.25pt; mso-position-horizontal-relative: char; mso-position-vertical-relative: line" coordsize="10464,7098" coordorigin="2527,3937" editas="canvas"><o:lock aspectratio="t" v:ext="edit"></o:lock><v:shapetype id=_x0000_t75 stroked="f" filled="f" path="m@4@5l@4@11@9@11@9@5xe" o:preferrelative="t" o:spt="75" coordsize="21600,21600"><v:stroke joinstyle="miter"></v:stroke><v:formulas><v:f eqn="if lineDrawn pixelLineWidth 0"></v:f><v:f eqn="sum @0 1 0"></v:f><v:f eqn="sum 0 0 @1"></v:f><v:f eqn="prod @2 1 2"></v:f><v:f eqn="prod @3 21600 pixelWidth"></v:f><v:f eqn="prod @3 21600 pixelHeight"></v:f><v:f eqn="sum @0 0 1"></v:f><v:f eqn="prod @6 1 2"></v:f><v:f eqn="prod @7 21600 pixelWidth"></v:f><v:f eqn="sum @8 21600 0"></v:f><v:f eqn="prod @7 21600 pixelHeight"></v:f><v:f eqn="sum @10 21600 0"></v:f></v:formulas><v:path o:connecttype="rect" gradientshapeok="t" o:extrusionok="f"></v:path><o:lock aspectratio="t" v:ext="edit"></o:lock></v:shapetype><v:shape id=_x0000_s1027 style="LEFT: 2527px; WIDTH: 10464px; POSITION: absolute; TOP: 3937px; HEIGHT: 7098px" o:preferrelative="f" type="#_x0000_t75"><v:fill o:detectmouseclick="t"></v:fill><v:path o:connecttype="none" o:extrusionok="t"></v:path><o:lock v:ext="edit" text="t"></o:lock></v:shape><v:group id=_x0000_s1028 style="LEFT: 2527px; WIDTH: 10464px; POSITION: absolute; TOP: 4411px; HEIGHT: 6624px" coordsize="5232,3312" coordorigin="336,288"><v:rect id=_x0000_s1029 style="LEFT: 336px; WIDTH: 5232px; POSITION: absolute; TOP: 288px; HEIGHT: 3312px; v-text-anchor: middle" fillcolor="#bbe0e3"></v:rect><v:shapetype id=_x0000_t202 path="m,l,21600r21600,l21600,xe" o:spt="202" coordsize="21600,21600"><v:stroke joinstyle="miter"></v:stroke><v:path o:connecttype="rect" gradientshapeok="t"></v:path></v:shapetype><v:shape id=_x0000_s1030 style="LEFT: 3840px; WIDTH: 1200px; POSITION: absolute; TOP: 432px; HEIGHT: 237px" type="#_x0000_t202" fillcolor="lime"><v:textbox inset="1.75261mm,.87631mm,1.75261mm,.87631mm"><TABLE cellSpacing=0 cellPadding=0 width="100%"><TBODY><TR><TD style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent">Click here to edit<o:p></o:p>

</TD></TR></TBODY></TABLE></v:textbox></v:shape><v:shape id=_x0000_s1031 style="LEFT: 672px; WIDTH: 1200px; POSITION: absolute; TOP: 1920px; HEIGHT: 237px" type="#_x0000_t202" fillcolor="#bbe0e3"><v:textbox inset="1.75261mm,.87631mm,1.75261mm,.87631mm"><TABLE cellSpacing=0 cellPadding=0 width="100%"><TBODY><TR><TD style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent">Branch1<o:p></o:p>

</TD></TR></TBODY></TABLE></v:textbox></v:shape><v:shape id=_x0000_s1032 style="LEFT: 672px; WIDTH: 1200px; POSITION: absolute; TOP: 816px; HEIGHT: 237px" type="#_x0000_t202" fillcolor="yellow"><v:textbox inset="1.75261mm,.87631mm,1.75261mm,.87631mm"><TABLE cellSpacing=0 cellPadding=0 width="100%"><TBODY><TR><TD style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent">
Field 1<o:p></o:p>

</TD></TR></TBODY></TABLE></v:textbox></v:shape><v:shape id=_x0000_s1033 style="LEFT: 3072px; WIDTH: 1200px; POSITION: absolute; TOP: 816px; HEIGHT: 237px" type="#_x0000_t202" fillcolor="yellow"><v:textbox inset="1.75261mm,.87631mm,1.75261mm,.87631mm"><TABLE cellSpacing=0 cellPadding=0 width="100%"><TBODY><TR><TD style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent">
Field 3<o:p></o:p>

</TD></TR></TBODY></TABLE></v:textbox></v:shape><v:shape id=_x0000_s1034 style="LEFT: 1872px; WIDTH: 1200px; POSITION: absolute; TOP: 816px; HEIGHT: 237px" type="#_x0000_t202" fillcolor="yellow"><v:textbox inset="1.75261mm,.87631mm,1.75261mm,.87631mm"><TABLE cellSpacing=0 cellPadding=0 width="100%"><TBODY><TR><TD style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent">
Field 2<o:p></o:p>

</TD></TR></TBODY></TABLE></v:textbox></v:shape><v:shape id=_x0000_s1035 style="LEFT: 1872px; WIDTH: 1200px; POSITION: absolute; TOP: 1056px; HEIGHT: 237px" type="#_x0000_t202" fillcolor="yellow"><v:textbox inset="1.75261mm,.87631mm,1.75261mm,.87631mm"><TABLE cellSpacing=0 cellPadding=0 width="100%"><TBODY><TR><TD style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent">
Field 5<o:p></o:p>

</TD></TR></TBODY></TABLE></v:textbox></v:shape><v:shape id=_x0000_s1036 style="LEFT: 3072px; WIDTH: 1200px; POSITION: absolute; TOP: 1056px; HEIGHT: 237px" type="#_x0000_t202" fillcolor="yellow"><v:textbox inset="1.75261mm,.87631mm,1.75261mm,.87631mm"><TABLE cellSpacing=0 cellPadding=0 width="100%"><TBODY><TR><TD style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent">
Field 6<o:p></o:p>

</TD></TR></TBODY></TABLE></v:textbox></v:shape><v:shape id=_x0000_s1037 style="LEFT: 672px; WIDTH: 1200px; POSITION: absolute; TOP: 1056px; HEIGHT: 237px" type="#_x0000_t202" fillcolor="yellow"><v:textbox inset="1.75261mm,.87631mm,1.75261mm,.87631mm"><TABLE cellSpacing=0 cellPadding=0 width="100%"><TBODY><TR><TD style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent">
Field 4<o:p></o:p>

</TD></TR></TBODY></TABLE></v:textbox></v:shape><v:shape id=_x0000_s1038 style="LEFT: 1872px; WIDTH: 1200px; POSITION: absolute; TOP: 1920px; HEIGHT: 237px" type="#_x0000_t202" fillcolor="#bbe0e3"><v:textbox inset="1.75261mm,.87631mm,1.75261mm,.87631mm"><TABLE cellSpacing=0 cellPadding=0 width="100%"><TBODY><TR><TD style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent">
3<o:p></o:p>

</TD></TR></TBODY></TABLE></v:textbox></v:shape><v:shape id=_x0000_s1039 style="LEFT: 4272px; WIDTH: 1200px; POSITION: absolute; TOP: 1920px; HEIGHT: 237px" type="#_x0000_t202" fillcolor="#bbe0e3"><v:textbox inset="1.75261mm,.87631mm,1.75261mm,.87631mm"><TABLE cellSpacing=0 cellPadding=0 width="100%"><TBODY><TR><TD style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent">
2<o:p></o:p>

</TD></TR></TBODY></TABLE></v:textbox></v:shape><v:shape id=_x0000_s1040 style="LEFT: 3072px; WIDTH: 1200px; POSITION: absolute; TOP: 1920px; HEIGHT: 237px" type="#_x0000_t202" fillcolor="#bbe0e3"><v:textbox inset="1.75261mm,.87631mm,1.75261mm,.87631mm"><TABLE cellSpacing=0 cellPadding=0 width="100%"><TBODY><TR><TD style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent">
1<o:p></o:p>

</TD></TR></TBODY></TABLE></v:textbox></v:shape><v:shape id=_x0000_s1041 style="LEFT: 672px; WIDTH: 1200px; POSITION: absolute; TOP: 2160px; HEIGHT: 237px" type="#_x0000_t202" fillcolor="#bbe0e3"><v:textbox inset="1.75261mm,.87631mm,1.75261mm,.87631mm"><TABLE cellSpacing=0 cellPadding=0 width="100%"><TBODY><TR><TD style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent">Branch2<o:p></o:p>

</TD></TR></TBODY></TABLE></v:textbox></v:shape><v:shape id=_x0000_s1042 style="LEFT: 1872px; WIDTH: 1200px; POSITION: absolute; TOP: 2160px; HEIGHT: 237px" type="#_x0000_t202" fillcolor="#bbe0e3"><v:textbox inset="1.75261mm,.87631mm,1.75261mm,.87631mm"><TABLE cellSpacing=0 cellPadding=0 width="100%"><TBODY><TR><TD style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent">
<o:p> </o:p>

</TD></TR></TBODY></TABLE></v:textbox></v:shape><v:shape id=_x0000_s1043 style="LEFT: 4272px; WIDTH: 1200px; POSITION: absolute; TOP: 2160px; HEIGHT: 237px" type="#_x0000_t202" fillcolor="#bbe0e3"><v:textbox inset="1.75261mm,.87631mm,1.75261mm,.87631mm"><TABLE cellSpacing=0 cellPadding=0 width="100%"><TBODY><TR><TD style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent">
<o:p> </o:p>

</TD></TR></TBODY></TABLE></v:textbox></v:shape><v:shape id=_x0000_s1044 style="LEFT: 3072px; WIDTH: 1200px; POSITION: absolute; TOP: 2160px; HEIGHT: 237px" type="#_x0000_t202" fillcolor="#bbe0e3"><v:textbox inset="1.75261mm,.87631mm,1.75261mm,.87631mm"><TABLE cellSpacing=0 cellPadding=0 width="100%"><TBODY><TR><TD style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent">
<o:p> </o:p>

</TD></TR></TBODY></TABLE></v:textbox></v:shape><v:shape id=_x0000_s1045 style="LEFT: 672px; WIDTH: 1200px; POSITION: absolute; TOP: 1680px; HEIGHT: 237px" type="#_x0000_t202" fillcolor="#36f"><v:textbox inset="1.75261mm,.87631mm,1.75261mm,.87631mm"><TABLE cellSpacing=0 cellPadding=0 width="100%"><TBODY><TR><TD style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent">
Branch No<o:p></o:p>

</TD></TR></TBODY></TABLE></v:textbox></v:shape><v:shape id=_x0000_s1046 style="LEFT: 1872px; WIDTH: 1200px; POSITION: absolute; TOP: 1680px; HEIGHT: 237px" type="#_x0000_t202" fillcolor="#36f"><v:textbox inset="1.75261mm,.87631mm,1.75261mm,.87631mm"><TABLE cellSpacing=0 cellPadding=0 width="100%"><TBODY><TR><TD style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent">
Total Revenue<o:p></o:p>

</TD></TR></TBODY></TABLE></v:textbox></v:shape><v:shape id=_x0000_s1047 style="LEFT: 4272px; WIDTH: 1200px; POSITION: absolute; TOP: 1680px; HEIGHT: 237px" type="#_x0000_t202" fillcolor="#36f"><v:textbox inset="1.75261mm,.87631mm,1.75261mm,.87631mm"><TABLE cellSpacing=0 cellPadding=0 width="100%"><TBODY><TR><TD style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent">
Net Revenue<o:p></o:p>

</TD></TR></TBODY></TABLE></v:textbox></v:shape><v:shape id=_x0000_s1048 style="LEFT: 3072px; WIDTH: 1200px; POSITION: absolute; TOP: 1680px; HEIGHT: 237px" type="#_x0000_t202" fillcolor="#36f"><v:textbox inset="1.75261mm,.87631mm,1.75261mm,.87631mm"><TABLE cellSpacing=0 cellPadding=0 width="100%"><TBODY><TR><TD style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent">
Total Cost<o:p></o:p>

</TD></TR></TBODY></TABLE></v:textbox></v:shape></v:group><v:shape id=_x0000_s1049 style="LEFT: 2527px; WIDTH: 10464px; POSITION: absolute; TOP: 3937px; HEIGHT: 608px" type="#_x0000_t202" fillcolor="black" strokeweight="2pt" strokecolor="aqua"><v:textbox inset="1.75261mm,.87631mm,1.75261mm,.87631mm"><TABLE cellSpacing=0 cellPadding=0 width="100%"><TBODY><TR><TD style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent">
SECTOR 1<o:p></o:p>

</TD></TR></TBODY></TABLE></v:textbox></v:shape><?xml:namespace prefix = w ns = "urn:schemas-microsoft-com:office:word" /><w:wrap type="none"></w:wrap><w:anchorlock></w:anchorlock></v:group>
<o:p> </o:p>
<o:p> </o:p>
(Fig 2 / Click ‘Edit’ Button & Red Arrow)
SECTOR


<o:p> </o:p>
<o:p></o:p>
<o:p></o:p>
(Fig 3 / Key in empty fields & Click ‘Yes’ Button)
<o:p>
u8tzc8tsqvbwaqfu2g0o_thumb.jpg
</o:p>
<o:p></o:p>
(Fig 4 / Figures will be populated to main screen à click ‘save’)
<o:p>
h69e3wkzhm6jwauw4cli_thumb.jpg
</o:p>
<o:p></o:p>
<o:p></o:p>
<o:p></o:p>
<o:p></o:p><o:p></o:p>
THE SPREADSHEET DATA FROM WHICH FIGURES ARE PICKED TO FILL THE EMPTY FIELDS IN THE WEBSITE<o:p></o:p>

(Figure 5 / Table in Spreadsheet)
<o:p></o:p>
<TABLE class=MsoNormalTable style="MARGIN: auto auto auto -64.5pt; WIDTH: 573.9pt; BORDER-COLLAPSE: collapse; mso-padding-alt: 0in 5.4pt 0in 5.4pt" cellSpacing=0 cellPadding=0 width=765 border=0><TBODY><TR style="HEIGHT: 12.75pt; mso-yfti-irow: 0; mso-yfti-firstrow: yes"><TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: silver; PADDING-BOTTOM: 0in; BORDER-LEFT: windowtext 1pt solid; WIDTH: 21pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 12.75pt; mso-border-alt: solid windowtext .5pt" vAlign=bottom noWrap width=28>
<o:p></o:p>

</TD><TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: silver; PADDING-BOTTOM: 0in; BORDER-LEFT: #e0dfe3; WIDTH: 93.9pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 12.75pt; mso-border-top-alt: solid windowtext .5pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt" vAlign=bottom noWrap width=125>
A<o:p></o:p>

</TD><TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: silver; PADDING-BOTTOM: 0in; BORDER-LEFT: #e0dfe3; WIDTH: 54.1pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 12.75pt; mso-border-top-alt: solid windowtext .5pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt" vAlign=bottom noWrap width=72>
B<o:p></o:p>

</TD><TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: silver; PADDING-BOTTOM: 0in; BORDER-LEFT: #e0dfe3; WIDTH: 50pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 12.75pt; mso-border-top-alt: solid windowtext .5pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt" vAlign=bottom noWrap width=67>
C<o:p></o:p>

</TD><TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: silver; PADDING-BOTTOM: 0in; BORDER-LEFT: #e0dfe3; WIDTH: 282.9pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 12.75pt; mso-border-top-alt: solid windowtext .5pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt" vAlign=bottom noWrap width=377>
D<o:p></o:p>

</TD><TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: silver; PADDING-BOTTOM: 0in; BORDER-LEFT: #e0dfe3; WIDTH: 1in; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 12.75pt; mso-border-top-alt: solid windowtext .5pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt" vAlign=bottom noWrap width=96>
E<o:p></o:p>

</TD></TR><TR style="HEIGHT: 38.25pt; mso-yfti-irow: 1"><TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #e0dfe3; PADDING-LEFT: 5.4pt; BACKGROUND: silver; PADDING-BOTTOM: 0in; BORDER-LEFT: windowtext 1pt solid; WIDTH: 21pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 38.25pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt" width=28>
1<o:p></o:p>

</TD><TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #e0dfe3; PADDING-LEFT: 5.4pt; BACKGROUND: #ccffff; PADDING-BOTTOM: 0in; BORDER-LEFT: #e0dfe3; WIDTH: 93.9pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 38.25pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt" width=125>
URLs of different sectors<o:p></o:p>

</TD><TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #e0dfe3; PADDING-LEFT: 5.4pt; BACKGROUND: #ccffff; PADDING-BOTTOM: 0in; BORDER-LEFT: #e0dfe3; WIDTH: 54.1pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 38.25pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt" width=72>
Total Revenue<o:p></o:p>

</TD><TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #e0dfe3; PADDING-LEFT: 5.4pt; BACKGROUND: #ccffff; PADDING-BOTTOM: 0in; BORDER-LEFT: #e0dfe3; WIDTH: 50pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 38.25pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt" width=67>
Total Cost<o:p></o:p>

</TD><TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #e0dfe3; PADDING-LEFT: 5.4pt; BACKGROUND: #ccffff; PADDING-BOTTOM: 0in; BORDER-LEFT: #e0dfe3; WIDTH: 282.9pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 38.25pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt" width=377>
The identifier in the source code for each Branch No Dropdown Box<o:p></o:p>

</TD><TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #e0dfe3; PADDING-LEFT: 5.4pt; BACKGROUND: #ccffff; PADDING-BOTTOM: 0in; BORDER-LEFT: #e0dfe3; WIDTH: 1in; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 38.25pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt" width=96>
How many of the same Branch No<o:p></o:p>

</TD></TR><TR style="HEIGHT: 12.75pt; mso-yfti-irow: 2"><TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #e0dfe3; PADDING-LEFT: 5.4pt; BACKGROUND: silver; PADDING-BOTTOM: 0in; BORDER-LEFT: windowtext 1pt solid; WIDTH: 21pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 12.75pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt" vAlign=bottom noWrap width=28>
2<o:p></o:p>

</TD><TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #e0dfe3; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #e0dfe3; WIDTH: 93.9pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt" width=125>
URL for Sector 1<o:p></o:p>

</TD><TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #e0dfe3; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #e0dfe3; WIDTH: 54.1pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt" vAlign=bottom noWrap width=72>
3<o:p></o:p>

</TD><TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #e0dfe3; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #e0dfe3; WIDTH: 50pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt" vAlign=bottom noWrap width=67>
1<o:p></o:p>

</TD><TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #e0dfe3; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #e0dfe3; WIDTH: 282.9pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt" vAlign=bottom noWrap width=377>
SourceCode Identifier for Sector 1 / Branch 1 Popup Box<o:p></o:p>

</TD><TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #e0dfe3; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #e0dfe3; WIDTH: 1in; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt" vAlign=bottom noWrap width=96>
2<o:p></o:p>

</TD></TR><TR style="HEIGHT: 12.75pt; mso-yfti-irow: 3"><TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #e0dfe3; PADDING-LEFT: 5.4pt; BACKGROUND: silver; PADDING-BOTTOM: 0in; BORDER-LEFT: windowtext 1pt solid; WIDTH: 21pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 12.75pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt" vAlign=bottom noWrap width=28>
3<o:p></o:p>

</TD><TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #e0dfe3; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #e0dfe3; WIDTH: 93.9pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt" width=125>
URL for Sector 2<o:p></o:p>

</TD><TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #e0dfe3; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #e0dfe3; WIDTH: 54.1pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt" vAlign=bottom noWrap width=72>
5<o:p></o:p>

</TD><TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #e0dfe3; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #e0dfe3; WIDTH: 50pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt" vAlign=bottom noWrap width=67>
1<o:p></o:p>

</TD><TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #e0dfe3; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #e0dfe3; WIDTH: 282.9pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt" vAlign=bottom noWrap width=377>
SourceCode Identifier for Sector 1 / Branch 2 Popup Box<o:p></o:p>

</TD><TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #e0dfe3; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #e0dfe3; WIDTH: 1in; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt" vAlign=bottom noWrap width=96>
1<o:p></o:p>

</TD></TR><TR style="HEIGHT: 12.75pt; mso-yfti-irow: 4; mso-yfti-lastrow: yes"><TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #e0dfe3; PADDING-LEFT: 5.4pt; BACKGROUND: silver; PADDING-BOTTOM: 0in; BORDER-LEFT: windowtext 1pt solid; WIDTH: 21pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 12.75pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt" vAlign=bottom noWrap width=28>
4<o:p></o:p>

</TD><TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #e0dfe3; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #e0dfe3; WIDTH: 93.9pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt" width=125>
URL for Sector 3<o:p></o:p>

</TD><TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #e0dfe3; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #e0dfe3; WIDTH: 54.1pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt" vAlign=bottom noWrap width=72>
4<o:p></o:p>

</TD><TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #e0dfe3; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #e0dfe3; WIDTH: 50pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt" vAlign=bottom noWrap width=67>
1<o:p></o:p>

</TD><TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #e0dfe3; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #e0dfe3; WIDTH: 282.9pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt" vAlign=bottom noWrap width=377>
SourceCode Identifier for Sector 1 / Branch 3 Popup Box<o:p></o:p>

</TD><TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #e0dfe3; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #e0dfe3; WIDTH: 1in; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt" vAlign=bottom noWrap width=96>
2<o:p></o:p>


</TD></TR></TBODY></TABLE><o:p></o:p>​
<o:p></o:p>
So as I run the macro from the spreadsheet, it will:
(1) open up URL for Sector 1 à work within the webpage for Sector 1
a. click the green ‘Click here to edit’ button
b. click the red arrow to bring out the PopUp box (Red) for Branch1
c. fill in all the empty fields for Branch 1 (the empty fields for ‘Total Revenue’ & ‘Total Cost’)
d. click the green ‘Yes’ button à this will close the PopUp box & upload the figures to the empty fields (as in Fig 4)
e. click the green ‘Click here to save’ button (as in Fig 4)
(2) re-run the macro through a for-loop so that it repeats all the steps above to work on URL for Sector 2
<o:p></o:p>
PROBLEMS<o:p></o:p>
· Without using sendkeys, I am unable to get the macro to upload the figures into the empty fields à the macro just stops & runs into errors because I do not know how to write to access the hidden input (I think)<o:p></o:p>
· Even when using sendkeys, it is very unstable à the macro updates the wrong figures, e.g. Total Revenue = 1 instead of 3 for Branch 1 (inputted the Total Cost instead). Using the above example, I am tabbing 6 times to get to the re<o:p></o:p>
· PLEASE HELP WITH THIS!!!!
· I have put in the relevant source code & the existing macro below. Hope someone can advise!
<o:p></o:p>
<o:p></o:p>
SOURCE CODE OF WEBSITE<o:p></o:p>
(For Fig 1 / ‘Edit’ Button)<o:p></o:p>
<o:p></o:p>
type="button" name=" clickmetoedit " id=" clickmetoedit" class="greenButton" value="Edit in fixed mode" *******="editModule()">

</TD>
</TR>
</TABLE>

<HR class=blue_10B SIZE=1>
</TD>
</TR>
<TR align="left">
<TD>

<TABLE height="100%" cellSpacing=1 cellPadding=1 width="100%"><!-- Module start -->
<TBODY><TR>
<TD colSpan=4>

<o:p></o:p>
<o:p></o:p>
<o:p></o:p>
<o:p></o:p>
<o:p></o:p>
<o:p></o:p>
<o:p></o:p>
(For Fig 3 / To key in revenue and cost values)<o:p></o:p>
<o:p></o:p>
<o:p></o:p>
Branch1
<INPUT class=C55_black_13 id=branchid2 type=hidden value="Branch2_[FONT=Arial>PopupBox<FONT][SIZE=3>][COLOR=name=branch2 black?><FONT face=Arial>PopupBox<FONT face=][/COLOR][/SIZE][/FONT]


</TD>
<TD width="2%">
arrow.gif
[FONT=Arial>][SIZE=3>][COLOR=><FONT face=Arial> Popup Box<FONT face=][/COLOR]
[/FONT]

[/SIZE]</TD>
<!--


<TD id="'Branch2_
[FONT=Arial>Popup][SIZE=3>][COLOR=align=right black?><FONT face=Arial>Popup Box<FONT face=][/COLOR][/SIZE][/FONT]
<LABEL class=C55_black_13 id=netrevenue2label>
2
</LABEL>
<INPUT type=hidden name=totalrevenue_2 font <>
id="netrevenue2" class="C55_black_13" value="2">

</TD>


<TD align=right>

<LABEL class=C55_black_13 id=" totalrev2label ">3</LABEL>
<INPUT class=C55_black_13 id=totalrev2 type=hidden value=4 name=total_rev2>

</TD>
<TD align=right>
<LABEL class=C55_black_13 id=totalcostlabel_2>1</LABEL>
<INPUT class=C55_black_13 id=totalcost2 type=hidden value=1 name=totalcost_2>

</TD>
<TD align=right>

<o:p></o:p>
<o:p></o:p>
<o:p></o:p>
<o:p></o:p>
MY MACRO <o:p></o:p>
Sub FillInternetForms()
<o:p></o:p>
Dim Button As HTMLButtonElement
Dim btnInput As MSHTML.HTMLInputElement, LoginBtn As MSHTML.HTMLInputElement
Dim ElementCol As MSHTML.IHTMLElementCollection
Dim Link As MSHTML.HTMLAnchorElement
Dim Done As Long, Nm As Long
<o:p></o:p>
Dim r As Integer
r = 2
<o:p></o:p>
Dim url As String
<o:p></o:p>
Application.ScreenUpdating = False
Nm = 1234
<o:p></o:p>
Set appIE = New InternetExplorer
<o:p></o:p>
For r = 2 To 5
url = Cells(1, 5).Value & Cells(r, 1).Value
<o:p></o:p>
<o:p></o:p>
With appIE
.navigate url


.Visible = True
End With
<o:p></o:p>
<o:p></o:p>
' ================= click the edit button ==============================
Do While appIE.Busy Or appIE.readyState <> READYSTATE_COMPLETE
DoEvents
<?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" /><st1:place w:st="on">Loop</st1:place>
<o:p></o:p>
Done = 0: i = 1
On Error Resume Next
Do While Done <> 1 Or Err.Number <> 0
Done = 0
Set ElementCol = appIE.Document.getElementsByTagName("Input")
For Each btnInput In ElementCol
If btnInput.Name = "clickmetoedit" Then
Done = Done + 1
btnInput.Click
End If
Next btnInput
<st1:place w:st="on">Loop</st1:place>
On Error GoTo 0
<o:p></o:p>
Do While appIE.Busy Or appIE.readyState <> READYSTATE_COMPLETE
DoEvents
<st1:place w:st="on">Loop</st1:place>
<o:p></o:p>
' ================= click the arrow image to bring up the Pop-up Box ===========
Done = 0: i = 1
On Error Resume Next
Do While Done <> 1 Or Err.Number <> 0
Done = 0
Set ElementCol = appIE.Document.getElementsByTagName("img")
For Each btnInput In ElementCol
If InStr(1, btnInput.getAttribute("*******"), Cells(r, 5).Value) Then
Done = Done + 1
btnInput.Click
End If
i = i + 1
Next btnInput
<st1:place w:st="on">Loop</st1:place>
<o:p></o:p>
<o:p></o:p>
' ================= click the arrow image to bring out the Pop-Up Box =========
For i = 1 To 42 + Cells(r, 6).Value
SendKeys "{Tab}", True
Application.Wait Now + TimeValue("00:00:01")
Next i
<o:p></o:p>
<o:p></o:p>
<o:p></o:p>
' ================= USE SENDKEYS TO UPLOAD THE FIGURES ========
<o:p></o:p>
<o:p></o:p>
'=========copy figure from cell B2 of the excel sheet into ‘Total Revenue’ field =======
Application.Wait Now + TimeValue("00:00:03")
SendKeys CStr(Worksheets(1).Cells(r, 2).Value), True
Application.Wait Now + TimeValue("00:00:03")
<o:p></o:p>
'=========copy figure from cell B2 of the excel sheet into ‘Total Cost’ field ========
'SendKeys "{Tab}", True
'Application.Wait Now + TimeValue("00:00:03")
'SendKeys CStr(Worksheets(1).Cells(r, 3).Value), True
'Application.Wait Now + TimeValue("00:00:03")
<o:p></o:p>
<o:p></o:p>
<o:p></o:p>
Do While appIE.Busy Or appIE.readyState <> READYSTATE_COMPLETE
DoEvents
<st1:place w:st="on">Loop</st1:place>
<o:p></o:p>
<o:p></o:p>
<o:p></o:p>
' =========== click the confirm button ===================
<o:p></o:p>
Set ElementCol = appIE.Document.getElementsByTagName("Input")
For Each btnInput In ElementCol
If btnInput.Name = "clickmetoconfirm" Then
Done = Done + 1
btnInput.Click
End If
Next btnInput
<o:p></o:p>
<o:p></o:p>
<o:p></o:p>
' =============== click the savebutton =============
Set ElementCol = appIE.Document.getElementsByTagName("Input")
For Each btnInput In ElementCol
If btnInput.Name = "clickmetosave" Then
Done = Done + 1
btnInput.Click
End If
Next btnInput

Application.Wait Now + TimeValue("00:00:01")
<o:p></o:p>
Next r
End Sub
<o:p></o:p>
<o:p></o:p>
<o:p></o:p>
<o:p></o:p>
<o:p></o:p>
<o:p></o:p>
<o:p></o:p>
<o:p></o:p>
<o:p></o:p>
<o:p></o:p>
<o:p></o:p>
<o:p></o:p>
<o:p></o:p>
<o:p></o:p>
<o:p></o:p>
<o:p></o:p>
<o:p></o:p>
<o:p></o:p>
<o:p></o:p>
<o:p></o:p>
<o:p></o:p>
<o:p></o:p>
<o:p></o:p>
<o:p></o:p>

</TR>
 
Last edited:

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Hi all, <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p> </o:p>
I have been at this problem for close to a year and finally got some headway but stuck at the last leg. Appreciate that someone can help me with this!<o:p> </o:p>
OBJECTIVE OF THE MACRO (BASICALLY INTERNET FORM FILLING)<o:p></o:p>
  • Open up multiple websites through the multiple weblinks recorded in a spreadsheet<o:p></o:p>
  • Click the relevant buttons & copy some numerical figures from the spreadsheet into the websites, then click on the submit button in the websites to upload the figures<o:p></o:p>
<o:p> </o:p>PROBLEMS<o:p></o:p>
  • Unable to write the macro to upload figures from the spreadsheet<o:p></o:p>
    • The fields to fill belong to ‘hidden input’ type<o:p></o:p>
    • Unable to access it like what was done for clicking edit button & submit button<o:p></o:p>
  • Currently used an alternative à use ‘sendkeys method’ to (1) tab through the other fields in the website, (2) copy figures from the spreadsheet, (3) paste into the empty field which was tabbed to<o:p></o:p>
    • However, sendkeys are very unstable & sometimes tab to the wrong field!<o:p></o:p>
<o:p> </o:p>Will give more elaboration below!<o:p></o:p>
<o:p> </o:p>
ACTUAL WEB LAYOUT<o:p></o:p>
<o:p> </o:p>
(Fig 1 / Before clicking ‘Edit’ Button)
<o:p>
r0gabecv06mgh8gyh08w.jpg
</o:p>

(Fig 3 / Key in empty fields & Click ‘Yes’ Button)
<o:p>
w3jjzk3zvrwcmsrhxm1g.jpg
</o:p>

(Fig 4 / Figures will be populated to main screen à click ‘save’)
<o:p>
fc7ss3fu9zigi0i7bzw0.jpg
</o:p>
<o:p> </o:p><o:p> </o:p>
<o:p> </o:p>
THE SPREADSHEET DATA FROM WHICH FIGURES ARE PICKED TO FILL THE EMPTY FIELDS IN THE WEBSITE<o:p></o:p>
<o:p></o:p>
(Figure 5 / Table in Spreadsheet)<o:p> </o:p>
<TABLE class=MsoNormalTable style="MARGIN: auto auto auto -64.5pt; WIDTH: 573.9pt; BORDER-COLLAPSE: collapse; mso-padding-alt: 0in 5.4pt 0in 5.4pt" cellSpacing=0 cellPadding=0 width=765 border=0><TBODY><TR style="HEIGHT: 12.75pt; mso-yfti-irow: 0; mso-yfti-firstrow: yes"><TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: silver; PADDING-BOTTOM: 0in; BORDER-LEFT: windowtext 1pt solid; WIDTH: 21pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 12.75pt; mso-border-alt: solid windowtext .5pt" vAlign=bottom noWrap width=28>
<o:p></o:p>
</TD><TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: silver; PADDING-BOTTOM: 0in; BORDER-LEFT: #e0dfe3; WIDTH: 93.9pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 12.75pt; mso-border-top-alt: solid windowtext .5pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt" vAlign=bottom noWrap width=125>
A<o:p></o:p>
</TD><TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: silver; PADDING-BOTTOM: 0in; BORDER-LEFT: #e0dfe3; WIDTH: 54.1pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 12.75pt; mso-border-top-alt: solid windowtext .5pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt" vAlign=bottom noWrap width=72>
B<o:p></o:p>
</TD><TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: silver; PADDING-BOTTOM: 0in; BORDER-LEFT: #e0dfe3; WIDTH: 50pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 12.75pt; mso-border-top-alt: solid windowtext .5pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt" vAlign=bottom noWrap width=67>
C<o:p></o:p>
</TD><TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: silver; PADDING-BOTTOM: 0in; BORDER-LEFT: #e0dfe3; WIDTH: 282.9pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 12.75pt; mso-border-top-alt: solid windowtext .5pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt" vAlign=bottom noWrap width=377>
D<o:p></o:p>
</TD><TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: silver; PADDING-BOTTOM: 0in; BORDER-LEFT: #e0dfe3; WIDTH: 1in; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 12.75pt; mso-border-top-alt: solid windowtext .5pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt" vAlign=bottom noWrap width=96>
E<o:p></o:p>
</TD></TR><TR style="HEIGHT: 38.25pt; mso-yfti-irow: 1"><TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #e0dfe3; PADDING-LEFT: 5.4pt; BACKGROUND: silver; PADDING-BOTTOM: 0in; BORDER-LEFT: windowtext 1pt solid; WIDTH: 21pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 38.25pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt" width=28>
1<o:p></o:p>
</TD><TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #e0dfe3; PADDING-LEFT: 5.4pt; BACKGROUND: #ccffff; PADDING-BOTTOM: 0in; BORDER-LEFT: #e0dfe3; WIDTH: 93.9pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 38.25pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt" width=125>
URLs of different sectors<o:p></o:p>
</TD><TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #e0dfe3; PADDING-LEFT: 5.4pt; BACKGROUND: #ccffff; PADDING-BOTTOM: 0in; BORDER-LEFT: #e0dfe3; WIDTH: 54.1pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 38.25pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt" width=72>
Total Revenue<o:p></o:p>
</TD><TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #e0dfe3; PADDING-LEFT: 5.4pt; BACKGROUND: #ccffff; PADDING-BOTTOM: 0in; BORDER-LEFT: #e0dfe3; WIDTH: 50pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 38.25pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt" width=67>
Total Cost<o:p></o:p>
</TD><TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #e0dfe3; PADDING-LEFT: 5.4pt; BACKGROUND: #ccffff; PADDING-BOTTOM: 0in; BORDER-LEFT: #e0dfe3; WIDTH: 282.9pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 38.25pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt" width=377>
The identifier in the source code for each Branch No Dropdown Box<o:p></o:p>
</TD><TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #e0dfe3; PADDING-LEFT: 5.4pt; BACKGROUND: #ccffff; PADDING-BOTTOM: 0in; BORDER-LEFT: #e0dfe3; WIDTH: 1in; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 38.25pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt" width=96>
How many of the same Branch No<o:p></o:p>
</TD></TR><TR style="HEIGHT: 12.75pt; mso-yfti-irow: 2"><TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #e0dfe3; PADDING-LEFT: 5.4pt; BACKGROUND: silver; PADDING-BOTTOM: 0in; BORDER-LEFT: windowtext 1pt solid; WIDTH: 21pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 12.75pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt" vAlign=bottom noWrap width=28>
2<o:p></o:p>
</TD><TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #e0dfe3; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #e0dfe3; WIDTH: 93.9pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt" width=125>
URL for Sector 1<o:p></o:p>
</TD><TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #e0dfe3; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #e0dfe3; WIDTH: 54.1pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt" vAlign=bottom noWrap width=72>
3<o:p></o:p>
</TD><TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #e0dfe3; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #e0dfe3; WIDTH: 50pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt" vAlign=bottom noWrap width=67>
1<o:p></o:p>
</TD><TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #e0dfe3; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #e0dfe3; WIDTH: 282.9pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt" vAlign=bottom noWrap width=377>
SourceCode Identifier for Sector 1 / Branch 1 Popup Box<o:p></o:p>
</TD><TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #e0dfe3; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #e0dfe3; WIDTH: 1in; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt" vAlign=bottom noWrap width=96>
2<o:p></o:p>
</TD></TR><TR style="HEIGHT: 12.75pt; mso-yfti-irow: 3"><TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #e0dfe3; PADDING-LEFT: 5.4pt; BACKGROUND: silver; PADDING-BOTTOM: 0in; BORDER-LEFT: windowtext 1pt solid; WIDTH: 21pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 12.75pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt" vAlign=bottom noWrap width=28>
3<o:p></o:p>
</TD><TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #e0dfe3; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #e0dfe3; WIDTH: 93.9pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt" width=125>
URL for Sector 2<o:p></o:p>
</TD><TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #e0dfe3; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #e0dfe3; WIDTH: 54.1pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt" vAlign=bottom noWrap width=72>
5<o:p></o:p>
</TD><TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #e0dfe3; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #e0dfe3; WIDTH: 50pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt" vAlign=bottom noWrap width=67>
1<o:p></o:p>
</TD><TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #e0dfe3; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #e0dfe3; WIDTH: 282.9pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt" vAlign=bottom noWrap width=377>
SourceCode Identifier for Sector 1 / Branch 2 Popup Box<o:p></o:p>
</TD><TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #e0dfe3; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #e0dfe3; WIDTH: 1in; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt" vAlign=bottom noWrap width=96>
1<o:p></o:p>
</TD></TR><TR style="HEIGHT: 12.75pt; mso-yfti-irow: 4; mso-yfti-lastrow: yes"><TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #e0dfe3; PADDING-LEFT: 5.4pt; BACKGROUND: silver; PADDING-BOTTOM: 0in; BORDER-LEFT: windowtext 1pt solid; WIDTH: 21pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 12.75pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt" vAlign=bottom noWrap width=28>
4<o:p></o:p>
</TD><TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #e0dfe3; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #e0dfe3; WIDTH: 93.9pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt" width=125>
URL for Sector 3<o:p></o:p>
</TD><TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #e0dfe3; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #e0dfe3; WIDTH: 54.1pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt" vAlign=bottom noWrap width=72>
4<o:p></o:p>
</TD><TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #e0dfe3; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #e0dfe3; WIDTH: 50pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt" vAlign=bottom noWrap width=67>
1<o:p></o:p>
</TD><TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #e0dfe3; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #e0dfe3; WIDTH: 282.9pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt" vAlign=bottom noWrap width=377>
SourceCode Identifier for Sector 1 / Branch 3 Popup Box<o:p></o:p>
</TD><TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #e0dfe3; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #e0dfe3; WIDTH: 1in; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt" vAlign=bottom noWrap width=96>
2<o:p></o:p>
</TD></TR></TBODY></TABLE>
<o:p> </o:p>
<o:p> </o:p>So as I run the macro from the spreadsheet, it will:
(1) open up URL for Sector 1 à work within the webpage for Sector 1
a. click the green ‘Click here to edit’ button
b. click the red arrow to bring out the PopUp box (Red) for Branch1
c. fill in all the empty fields for Branch 1 (the empty fields for ‘Total Revenue’ & ‘Total Cost’)
d. click the green ‘Yes’ button à this will close the PopUp box & upload the figures to the empty fields (as in Fig 4)
e. click the green ‘Click here to save’ button (as in Fig 4)
(2) re-run the macro through a for-loop so that it repeats all the steps above to work on URL for Sector 2
<o:p> </o:p>
PROBLEMS<o:p></o:p>
· Without using sendkeys, I am unable to get the macro to upload the figures into the empty fields à the macro just stops & runs into errors because I do not know how to write to access the hidden input (I think)<o:p></o:p>
· Even when using sendkeys, it is very unstable à the macro updates the wrong figures, e.g. Total Revenue = 1 instead of 3 for Branch 1 (inputted the Total Cost instead). Using the above example, I am tabbing 6 times to get to the re<o:p></o:p>
· PLEASE HELP WITH THIS!!!!
· I have put in the relevant source code & the existing macro below. Hope someone can advise!

<o:p> </o:p>SOURCE CODE OF WEBSITE<o:p></o:p>
(For Fig 1 / ‘Edit’ Button)<o:p></o:p>
<o:p> </o:p>
type="button" name=" clickmetoedit " id=" clickmetoedit" class="greenButton" value="Edit in fixed mode" *******="editModule()">

</td>
</tr>
</table>
<hr size="1" class="blue_10B" />
</td>
</tr>
<tr align="left">
<td>
<table width=100% height=100% cellspacing="1" cellpadding="1"><!-- Module start -->
<tr>
<td colspan="4">
<div id="countryPanel">
<o:p> </o:p>
<o:p> </o:p>
<o:p> </o:p><o:p> </o:p>
(For Fig 3 / To key in revenue and cost values)<o:p></o:p>
<o:p> </o:p><o:p> </o:p>
Branch1
<input type="hidden" name="branch2" id="branchid2" class="C55_black_13" value="Branch2_PopupBox " label="Branch2">
</td>
<td width="2%" >
<img src="/standard/images/icon/arrow.gif" width="15" height="13" border="" *******="sector.ui.branchlyPanel.show('Branch2_ Popup Box ')" ***********="this.style.cursor='hand'"/>
</td>
<!--

<td align="right" id="'Branch2_ Popup Box ">
<label id="netrevenue2label" class="C55_black_13">
2
</label>
<input type="hidden" name="totalrevenue_2"
id="netrevenue2" class="C55_black_13" value="2">
</td>

<td align="right">
<label id=" totalrev2label " class="C55_black_13">3</label>
<input type="hidden" name="total_rev2" id="totalrev2" class="C55_black_13" value="4">
</td>
<td align="right">
<label id="totalcostlabel_2" class="C55_black_13">1</label>
<input type="hidden" name="totalcost_2" id="totalcost2" class="C55_black_13" value="1">
</td>
<td align="right">

<o:p> </o:p>MY MACRO <o:p></o:p>
Sub FillInternetForms()
<o:p> </o:p>
Dim Button As HTMLButtonElement
Dim btnInput As MSHTML.HTMLInputElement, LoginBtn As MSHTML.HTMLInputElement
Dim ElementCol As MSHTML.IHTMLElementCollection
Dim Link As MSHTML.HTMLAnchorElement
Dim Done As Long, Nm As Long
<o:p> </o:p>
Dim r As Integer
r = 2
<o:p> </o:p>
Dim url As String
<o:p> </o:p>
Application.ScreenUpdating = False
Nm = 1234
<o:p> </o:p>
Set appIE = New InternetExplorer
<o:p> </o:p>
For r = 2 To 5
url = Cells(1, 5).Value & Cells(r, 1).Value
<o:p> </o:p>
<o:p> </o:p>
With appIE
.navigate url


.Visible = True
End With
<o:p> </o:p>
<o:p> </o:p>
' ================= click the edit button ==============================
Do While appIE.Busy Or appIE.readyState <> READYSTATE_COMPLETE
DoEvents
<?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" /><st1:place w:st="on">Loop</st1:place>
<o:p> </o:p>
Done = 0: i = 1
On Error Resume Next
Do While Done <> 1 Or Err.Number <> 0
Done = 0
Set ElementCol = appIE.Document.getElementsByTagName("Input")
For Each btnInput In ElementCol
If btnInput.Name = "clickmetoedit" Then
Done = Done + 1
btnInput.Click
End If
Next btnInput
<st1:place w:st="on">Loop</st1:place>
On Error GoTo 0
<o:p> </o:p>
Do While appIE.Busy Or appIE.readyState <> READYSTATE_COMPLETE
DoEvents
<st1:place w:st="on">Loop</st1:place>
<o:p> </o:p>
' ================= click the arrow image to bring up the Pop-up Box ===========
Done = 0: i = 1
On Error Resume Next
Do While Done <> 1 Or Err.Number <> 0
Done = 0
Set ElementCol = appIE.Document.getElementsByTagName("img")
For Each btnInput In ElementCol
If InStr(1, btnInput.getAttribute("*******"), Cells(r, 5).Value) Then
Done = Done + 1
btnInput.Click
End If
i = i + 1
Next btnInput
<st1:place w:st="on">Loop</st1:place>
<o:p> </o:p>
<o:p> </o:p>
' ================= click the arrow image to bring out the Pop-Up Box =========
For i = 1 To 42 + Cells(r, 6).Value
SendKeys "{Tab}", True
Application.Wait Now + TimeValue("00:00:01")
Next i
<o:p> </o:p>
<o:p> </o:p>
<o:p> </o:p>
' ================= USE SENDKEYS TO UPLOAD THE FIGURES ========
<o:p> </o:p>
<o:p> </o:p>
'=========copy figure from cell B2 of the excel sheet into ‘Total Revenue’ field =======
Application.Wait Now + TimeValue("00:00:03")
SendKeys CStr(Worksheets(1).Cells(r, 2).Value), True
Application.Wait Now + TimeValue("00:00:03")
<o:p> </o:p>
'=========copy figure from cell B2 of the excel sheet into ‘Total Cost’ field ========
'SendKeys "{Tab}", True
'Application.Wait Now + TimeValue("00:00:03")
'SendKeys CStr(Worksheets(1).Cells(r, 3).Value), True
'Application.Wait Now + TimeValue("00:00:03")
<o:p> </o:p>
<o:p> </o:p>
<o:p> </o:p>
Do While appIE.Busy Or appIE.readyState <> READYSTATE_COMPLETE
DoEvents
<st1:place w:st="on">Loop</st1:place>
<o:p> </o:p>
<o:p> </o:p>
' =========== click the confirm button ===================
<o:p> </o:p>
Set ElementCol = appIE.Document.getElementsByTagName("Input")
For Each btnInput In ElementCol
If btnInput.Name = "clickmetoconfirm" Then
Done = Done + 1
btnInput.Click
End If
Next btnInput
<o:p> </o:p>
<o:p> </o:p>
<o:p> </o:p>
' =============== click the savebutton =============
Set ElementCol = appIE.Document.getElementsByTagName("Input")
For Each btnInput In ElementCol
If btnInput.Name = "clickmetosave" Then
Done = Done + 1
btnInput.Click
End If
Next btnInput

Application.Wait Now + TimeValue("00:00:01")
<o:p> </o:p>
Next r
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,503
Messages
6,179,134
Members
452,890
Latest member
Nikhil Ramesh

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