internet explorer - Using VBA Excel to navigate a website by changing dropdown value -


i writing excel macro navigate utility company website , download of statements linked account. statement download page, need navigate each account's summary page. of accounts listed in dropdown - when manually click different account list, page updates new account. using tip got this question, able macro change dropdown value. problem is, though chooses new value list, page doesn't update new account. unfortunately, there no direct link each account's page looks dropdown passes value script. tried copying url down different accounts, no matter account it's on url same. here vba code in question:

do while < intnumberacct     ie.document.getelementbyid("ctl00_pagecontent_accountdropdown_billingaccountsdropdown").selectedindex =     call downloadstatement     = + 1 loop 

i tried refreshing ie after changes dropdown value, when refreshes reverts original value in dropdown. tried ie.document.getelementbyid("ctl00_pagecontent_accountdropdown_billingaccountsdropdown").click after selected new index, didn't have effect.

here html source code of dropdown - removed large chunk of accounts wouldn't long , obfuscated account numbers , addresses 'x':

<table style="width: 100%" cellpadding="0" cellspacing="0"> <tr>     <td valign="top" class="accountdropdownlabelcells" style="height: 25px;">         <strong>billing account:</strong>     </td>     <td valign="top" style="text-align: left" align="left">         <select name="ctl00$pagecontent$accountdropdown$billingaccountsdropdown" onchange="javascript:settimeout(&#39;__dopostback(\&#39;ctl00$pagecontent$accountdropdown$billingaccountsdropdown\&#39;,\&#39;\&#39;)&#39;, 0)" id="ctl00_pagecontent_accountdropdown_billingaccountsdropdown" style="width:250px;">           <option value="xxxxx">xxxxx(16 xxxxx dr)</option>           <option selected="xxxxx" value="xxxxx">xxxxx(18 xxxxxdr)</option>           <option value="xxxxx">xxxxx(20 xxxxx dr)</option>           <option value="xxxxx">xxxxx(22 xxxxxdr)</option>           <option value="xxxxx">xxxxx(28 xxxxx dr)</option>           <option value="xxxxx">xxxxx(30 xxxxxdr)</option>           <option value="xxxxx">xxxxx(34 xxxxxdr)</option> </select>         &nbsp;     </td> </tr>   </table> 

any ideas on how page update new account after selecting in dropdown appreciated.

once set index of dropdown need trigger change event.

select name="ctl00$pagecontent$accountdropdown$billingaccountsdropdown" onchange="javascript:settimeout('__dopostback(\'ctl00$pagecontent$accountdropdown$billingaccountsdropdown\',\'\')', 0)" id="ctl00_pagecontent_accountdropdown_billingaccountsdropdown" style="width:250px;"

doc.getelementbyid("xs_r_gender").selectedindex=1 doc.getelementbyid("xs_r_gender").fireevent("onchange") 

Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -