Microsoft Excel - Urgent help !!!! html tag values using VBA

Asked By Rajender Prasad on 30-Apr-13 01:08 PM

Dear ALL, I have the below htmldocument. and I want to execute href="javascript:getDetail('2487284');.. this link.
The number is coming from document.auxPersonSummaryForm.auxiliaryPersonID.value=auxPersonID; and I am unable to see the
value of it..

Please help



<script language="javascript">
 function getDetail(auxPersonID) {
  document.auxPersonSummaryForm.auxiliaryPersonID.value=auxPersonID;
  go(document.auxPersonSummaryForm);
 }
 function performAuxiliaryPersonAction(actionName) {
  document.auxPersonSummaryForm._action.value=actionName;
  go(document.auxPersonSummaryForm);
 }
</script>
 
<form name="auxPersonSummaryForm" method="post" action="control" autocomplete="on">
<input type="hidden" name="_flow" size="60" value="HouseholdMaintenance">
<input type="hidden" name="_action" size="60" value="DisplayAuxPersonSummary">
<input type="hidden" name="_win_name" size="60" value="COMPAS Window 2018737">
<input type="hidden" name="_old_flow" size="60" value="HouseholdMaintenance">
<input type="hidden" name="_old_action" size="60" value="RetrieveAuxPersonSummary">
<input type="hidden" name="_time_stamp" size="60" value="1367335459475">
 
<input type="hidden" name="auxiliaryPersonID" value="">
<div align='left'><table cellpadding='3' cellspacing='0' border='0' width='100%' class=''>
 <tr class="E">
  <td>MAINTAIN AUXILIARY PERSON(S)</td>
  <td align="right" nowrap>[<a href="javascript:performAuxiliaryPersonAction('DisplayNewAuxiliaryPerson');" class="linkonDark">add auxiliary person</a>] &nbsp; [<a href="javascript:performAuxiliaryPersonAction('ReturnToHousehold');" class="linkonDark">RETURN to household</a>]</td>
 </tr>
</table></div>
<table border='0' cellpadding='3' cellspacing='0' width='100%' class='results'>
<tr class='listhead'>
<td>
Type</td>
<td>
Relationship</td>
<td>
Name/Entity Contact</td>
<td>
Entity</td>
<td>
Effective Period</td>
<td>
<div align='center'>Maintain</div></td>
</tr>
 
<tr  class='tinybold'  >
<td>
AUTHORIZED REPRESENTATIVE</td>
<td>
NIKKI L BLAHA</td>
<td>
CARL BIRNEY</td>
<td>
&nbsp;</td>
<td>
04/24/2013 to --/--/----</td>
<td>
<div align='center'><a class='linkonLite' href="javascript:getDetail('2487284');"><img src='./images/buttons/btn-edit.gif' border='0'></a></div>
</td>
</tr>
 
<tr  class='tinybold'  >
<td>
AUTHORIZED REPRESENTATIVE</td>
<td>
NIKKI L BLAHA</td>
<td>
LINDY BIRNEY</td>
<td>
&nbsp;</td>
<td>
04/24/2013 to --/--/----</td>
<td>
<div align='center'><a class='linkonLite' href="javascript:getDetail('2486573');"><img src='./images/buttons/btn-edit.gif' border='0'></a></div>
</td>
</tr>
 
</table>
 
</form>

Robbe Morris replied to Rajender Prasad on 30-Apr-13 01:51 PM
I'm going to assume you are using some component to get a stream of this html.  The MSXML components or something else.  If that is the case, they have no browser or JavaScript engine to "execute" code.

If you can work the COM WebBrowser control into your VBA form, you could use it to trigger clicks off those anchor tags.
Rajender Prasad replied to Robbe Morris on 01-May-13 08:38 AM
This code is part of my automation of one IE application. I did not get what are asking for am so sorry.

Regards,
Prasad
Robbe Morris replied to Rajender Prasad on 01-May-13 08:44 AM
You posted your question in the Microsoft Excel topic.  How are you getting/working with this html?  The point I was making is that if you are not loading this html into some sort of browser engine, you can't execute JavaScript.