Check if Hyperlink has been previously clicked ?

Jaafar Tribak

Well-known Member
Joined
Dec 5, 2002
Messages
9,797
Office Version
  1. 2016
Platform
  1. Windows
Hi all,

As you know, when an hyperlink is clicked in excel or in other applications, its text color changes visually indicating that the link has already been followed. The color is reset to its default when re-opening excel. (Depending on the update automatic links at open setting)

I am wondering if there is a programmatic way of checking if an hyperlink has already been visited since the workbook was last opened.

I thought about using the Workbook_SheetFollowHyperlink event and tag the followed hyperlink(s) (using the Target argument) but I thought maybe there was a simpler more straightforward way, specially if the worksheets contain many hyperlinks.

Any thoughts.

Thank you.
 
Last edited:

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Hello Jaafar,

I was reading the following article about a week ago. I came across it by accident:-

https://excel.tips.net/T007198_Showing_Visited_Hyperlinks.html

It may help you in your quest.

Cheerio,
vcoolio.

Thanks vcoolio for answering.

I had already visited that link and others before posting here but none address the question asked in this thread ...The article talks about how to make the visited status of an hyperlink survive the save operation.
 
Last edited:
Upvote 0
Hi Jaafar,

After reading that article, I played around with colouring the relevant hyperlink cell and then using Offset(,1) to place the NOW() function in the adjacent cell to show when the hyperlink was last used.....no real luck with that idea. I suppose that your original idea may be the way to go. Simplicity doesn't really come into play with this issue!

Cheerio,
vcoolio.
 
Upvote 0
Surely, there are roundabout ways to solve this but what I had in mind was like having a Boolean function that simply takes an hyperlink object in its argument and return TRUE if previously visited FALSE otherwise without the need to use the FollowHyperlink event and store each hyperlink state somewehere.

I have just found something that looks promising namely the IAccessible::get_accState method of the IAccessible interface that is fortunately exposed in excel via the office library and then just check if the STATE_SYSTEM_TRAVERSED flag is set for the hyperlink.

Not sure how easy this is or if it would work at all.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,240
Members
452,621
Latest member
Laura_PinksBTHFT

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top