bpfsr
asked on
Click an Hyperlink in Internet Explorer Using an Excel Macro
Is there a general rule when writing a macro to clicking a hyperlink to move to the next page? For instance I am writing an macro that bring me to a page where I need to simply click a link to move on. Here is the link in the source code:
<table border="0" width="100%" cellspacing="0" cellpadding="4" align="center">
<tr><td valign="top">
<b class="h1">Choose a shipping address</b><br />Is the address you'd like to use displayed below? If so, click the corresponding "Ship to this address" button. Or you can <a href="#new-address">enter a new shipping address</a>.</td>
<td valign="top" align="right" width="200">
</td></tr>
</table>
<br />
I want to click the a href="#new-address" link. Any help much apprecaited.
<table border="0" width="100%" cellspacing="0" cellpadding="4" align="center">
<tr><td valign="top">
<b class="h1">Choose a shipping address</b><br />Is the address you'd like to use displayed below? If so, click the corresponding "Ship to this address" button. Or you can <a href="#new-address">enter a new shipping address</a>.</td>
<td valign="top" align="right" width="200">
</td></tr>
</table>
<br />
I want to click the a href="#new-address" link. Any help much apprecaited.
Hi
Hyperlinks, Anchors, and Links
In web terms, a hyperlink is a reference (an address) to a resource on the web.
Hyperlinks can point to any resource on the web: an HTML page, an image, a sound file, a movie, etc.
An anchor is a term used to define a hyperlink destination inside a document.
The HTML anchor element <a>, is used to define both hyperlinks and anchors.
We will use the term HTML link when the <a> element points to a resource, and the term HTML anchor when the <a> elements defines an address inside a document..
-------------------------- ---------- ---------- ---------- ---------- ---------- ----
An HTML Link
Link syntax:
<a href="url">Link </a>
The start tag contains attributes about the link.
The element content (Link text) defines the part to be displayed.
Note: The element content doesn't have to be text. You can link from an image or any other HTML element.
-------------------------- ---------- ---------- ---------- ---------- ---------- ----
The href Attribute
The href attribute defines the link "address".
This <a> element defines a link to experts-exchange:
<a href="https://www.experts-exchange.com/">Visit experts-exchange from here</a>
The code above will display like this in a browser:
Visit experts-exchange from here
-------------------------- ---------- ---------- ---------- ---------- ---------- ----
The target Attribute
The target attribute defines where the linked document will be opened.
The code below will open the document in a new browser window:
Example
<a href="https://www.experts-exchange.com/"
target="_blank">Visit experts-exchange from here</a>
-------------------------- ---------- ---------- ---------- ---------- ---------- ----
<a> Defines an anchor
Sudhakar A
Hyperlinks, Anchors, and Links
In web terms, a hyperlink is a reference (an address) to a resource on the web.
Hyperlinks can point to any resource on the web: an HTML page, an image, a sound file, a movie, etc.
An anchor is a term used to define a hyperlink destination inside a document.
The HTML anchor element <a>, is used to define both hyperlinks and anchors.
We will use the term HTML link when the <a> element points to a resource, and the term HTML anchor when the <a> elements defines an address inside a document..
--------------------------
An HTML Link
Link syntax:
<a href="url">Link </a>
The start tag contains attributes about the link.
The element content (Link text) defines the part to be displayed.
Note: The element content doesn't have to be text. You can link from an image or any other HTML element.
--------------------------
The href Attribute
The href attribute defines the link "address".
This <a> element defines a link to experts-exchange:
<a href="https://www.experts-exchange.com/">Visit experts-exchange from here</a>
The code above will display like this in a browser:
Visit experts-exchange from here
--------------------------
The target Attribute
The target attribute defines where the linked document will be opened.
The code below will open the document in a new browser window:
Example
<a href="https://www.experts-exchange.com/"
target="_blank">Visit experts-exchange from here</a>
--------------------------
<a> Defines an anchor
Sudhakar A
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I don't know why the question is going to be deleted.
Is that the author don't want?
Is that the author don't want?
ASKER
trunqk43 - I posted the question for deletion because the first two answers were so completely off-base I just figured I had not asked the question properly. Since you seem to be more on mark if you want to object and have the question reinstated, that would be fine with me. As for your solution I think it is close but not quite; the hyperlink I am looking to activate is an external link, not a link to an internal file.
<a href="#M4">Click Here</a>
The a place to go to:
<a href="m4.html">Here I am</a>