Opening a web page inside Ability

Of course, this requires Microsoft's Internet Explorer. The only trick here is knowing how to refer to Explorer (which is why we've included this as an example).

Sub OpenWebPage()

Dim mIE 

Set mIE = CreateObject("InternetExplorer.Application") 

mIE.Visible = True 

mIE.Navigate "http://www.ability.com" 

End Sub

The first line declares mIE as a variable to be used in this sub-routine. This is not strictly necessary but is good practice (so as not to confuse it with a globally defined variable of the same name were you to have a complex sequence of macros). The second line creates an instance of Explorer, the third line makes it visible to the user (rather than run in the background) and the last line navigates to the Ability web site.

Instead of "hard coding" the web site address, we can instead extract the URL from the current text. For example, in Spreadsheet, using the following line:

mIE.Navigate ActiveCell.Value 

causes the macro to take the text from the current cell, so that, if cell A1 had the text "http://www.ability.com" and was also the current cell, the macro would again navigate to the Ability web site.

Ability has a built-in function that performs a similar task – see HYPERLINK for details.