0

I'm very new to VBA and bumped into the below issue. Using VBA I've been trying to activate a href link in Internet Explorer.

HTML Code (I want to refer to line 'title = Show archived file'): Below html code states a table in which the href link is given.

    <td width="6%">
<table width="100%" border="0" cellspacing="0" cellpadding="1">
    <tbody><tr>           
        <td><a href="URL_Replaced_Due_To_Security_Reasons" target="_blank">
        <img title="View as printed" align="middle" 
        src="/umadmin/style/common/images/pdf_2.png" border="0"></a></td>                

        <td><a href="URL_Replaced_Due_To_Security_Reasons"    
        target="_blank"><img title="Show archived file" align="middle"    
        src="/umadmin/style/common/images/pdf.gif" border="0"></a></td>             
    </tr>        
   </tbody></table>
   </td>

I was able to open this link by using the following VBA coding:

InternetExplorer.Navigate "URL_Replaced_Due_To_Security_Reasons"

Thought I would like to click on this without referring to the link directly, as this link is variable according to some prior input.

So what I've tried was the below, which unfortunately gives me an error:

MyBrowser.Document.getElementsByTagName("a")("Show archived file").Click

If somebody could take a look at this, I would be most grateful.

Kind regards,

Vik

0 Answers0