how to cancel the vba followhyperlink?

陌路散爱 提交于 2019-12-05 18:14:56

You cannot prevent a click from following the hyperlink. You can test by yourself by setting a breakpoint in the Worksheet_FollowHyperlink sub. Excel follow the link before executing the code.

I can't see any event procedure that would help interfere and prevent the behavior.

Another tip i could give is to prevent Excel from creating hyperlinks or to do it by vba with a Worksheet_Change event.
Next, you could intercept a peuso-click with a Worksheet_SelectionChange and check if the cell contains a mail address.

Last but not least, if you do know that the e-mail client is Outlook, you can probably get the newly created mail to add attachments, recipients, message...

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!