Wednesday, November 20, 2013

How to trigger FollowHyperlink Event in Excel VBA with blank hyperlinks

Ugg & Lee - Hyperlinks
During a recent project, I just wished to run my Excel VBA app via hyperlinks. VBA has an event "FollowHyperlink" which triggers whenever you click on a hyperlink in your active workbook. But there are two main issues. First, Hyperlink cant be a blank and 2nd, if you provide a valid hyperlink then this event will trigger after url execution. In my case, i only wanted to trap the event without invoking the default browser. I tried to google it for any trick but couldn't found one. Did few experiments and I have finally found a handy way of doing it. :-)