This site will look better if you upgrade to a browser that supports web standards.
On another page, I demonstrated four ways to prevent or undo the automatic hyperlinks that XLv.X and XL2001 (along with WinXL97 and 00) insert. Those methods worked on a per entry, worksheet or workbook level. The following method can be used to prevent automatic hyperlinks from being created in ALL workbooks. The method is similar to that published in the Microsoft Knowledge Base, but overcomes its several shortcomings.
The method uses a class module and application events to delete automatic hyperlinks as soon as they are created. It does not prevent you from entering hyperlinks manually using the menu or keyboard shortcuts. This is how to implement it:
Public WithEvents NoHyperlink As Application Private Sub NoHyperlink_SheetChange(ByVal Sh As Object, _ ByVal Target As Range) On Error Resume Next Target.Hyperlinks.Delete On Error GoTo 0 End Sub
Dim objDelHyperlink As New Class1 Private Sub Workbook_Open() Set objDelHyperlink.NoHyperlink = Application End Sub
Every time you make an entry from now on, XL will check to see if that entry contains a hyperlink. If it does, it will delete the hyperlink, but not the content. Placing the file in XL's Startup directory ensures that the file will be loaded each time XL is started.
For more on Application Events, see Chip Pearson's explanation.
This page last updated
© Copyright 2001 - 2004 McGimpsey and Associates. Except where noted, all code on this site may be distributed under the Gnu GPL. Acknowledgement is appreciated.
Remove hyperlinks manually