Click on Hyperlink in Excel row based on condition

Hello guys,
I have an excel sheet with hyperlinks on the 3rd row. I want to be able to click on the hyperlink based on a condition i.e

if age = 19, click row 3(the hyperlink)

Please help.


Instead of clicking have you considered using Start Application?
If you use Read Range, then you can access the hyperlink in the table.

so, in other words, you can run it through a for each until row(“Age”).Tostring = “19”, then Start Application using Word and the filepath as row(“CV”).ToString.

Alternately you can use LINQ to jump straight to the row with age 19:

dt1.AsEnumerable.Where(Function(row) row("Age").ToString.Trim = "19" ).ToArray(0).Item("CV").ToString

Or you can run through a For each of every item that = “19” as well if that is required, rather than using .ToArray(0) to only take the first item that = “19”.

Regards. Hope I didn’t confuse you!

There are also Word activities instead of Start Application, which would probably be better.

Hi Clayton. Thanks for the quick response.
What I want is to be able to download the attachments (which might be in different formats) in row 3 as long as they meet the age requirement and this does not do that. Is there another way? Will appreciate your help

I see…
Here is another way.
If you use the data table to find the text value in the CV row like I presented.
Then, you can perform a Ctrl+f to search for that text, and after it is selected, perform the Menu key (or Shift+F10) and type “o” twice which will select the “Open Hyperlink”
For example,

TypeInto "[d(ctrl)]f[u(ctrl)]"+row("CV").ToString.Trim+"[k(enter)]"
TypeInto "[d(shift)][k(f10)][u(shift)]oo[k(enter)]"

I hope this works for you. I put this in quickly so have not tested the reliability.


1 Like

Thank you. Will try it out.

Hi Clayton, this didn’t work. I’ve also tried using the open browser activity as attached in this workflow, however it is not reading the hyperlink, its reading the text in the excel. Could you help please? is it possible for the browser to read the hyperlink address, not the text of the file

I apologize, I won’t have time to look into this fully. You might do some research online to find out how to get the hyperlink source from the text in the cell.

Also, if my other suggestion wasn’t working, it should at the very least get the cell selected, using Ctrl+f to find the text that is in the table. Then, performing the keystroke combo to open the link is the other half. It might be helpful to others if you can provide an example excel file and your workflow.

EDIT: Remember to also perform a suggested keystroke combination manually first to make sure you understand what it is supposed to do, then you can code that in your workflow.


Hi Clayton, I ended up doing a workaround for this. Not sure how effective it’ll be in the long run, but it works for now. Used your earlier CTRL+F suggestion to find the row.Item, However I was having issues with the (shift+f10+oo +enter combo) to open the hyperlink, so I created a macro in the excel sheet Ctrl+q and used the send hotkey activity.

Thanks again!!

1 Like