Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
JK JK is offline
external usenet poster
 
Posts: 78
Default Issues with Hyperlinks in XL97

My program includes a form that allows user to enter email and website, but
with some users (not all) the text becomes a hyperlink. It shouldn't. My
program allows XL97-XP so I want to program for XL97. However, when I use
the following in XL97

Sub ZapHyperlink()
ActiveSheet.Hyperlinks.Delete
End Sub

it reformats the font and borders in cell. It shouldn't. I can include
lengthy reformatting procedures to sub, but prefer not to. Does anyone have
a suggestion how to cleanly deal with this?

Thank you in advance. Jim Kobzeff


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 162
Default Issues with Hyperlinks in XL97

You could try snatching the text, clearing the range, then re-assigning
the text with a single quote ' in front of it:

Dim ws As Worksheet
Dim hyp As Hyperlink
Dim txt As String
Dim sRng As String

Set ws = Application.ActiveSheet

For Each hyp In ws.Hyperlinks
sRng = hyp.Range.Address
txt = hyp.Range.Text
ws.Range(sRng).Clear
ws.Range(sRng).Value = "'" & txt
Next
Set ws = Nothing

It worked for me, but I'm using Excel XP.

----
Nick Hebb
BreezeTree Software
http://www.breezetree.com

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 129
Default Issues with Hyperlinks in XL97

Hi,

how about something like this:
(I tested in Excel 2000. the font properties that are from the
'Hyperlink' style may be lost.)

Sub DeleteHyperlink()
ExecuteExcel4Macro "DEFINE.STYLE(""Normal"",0,0,0,0,0,0)"
ActiveSheet.Hyperlinks.Delete
ExecuteExcel4Macro "DEFINE.STYLE(""Normal"",1,1,1,1,1,1)"
End Sub

--
HTH,

okaizawa

JK wrote:
My program includes a form that allows user to enter email and website, but
with some users (not all) the text becomes a hyperlink. It shouldn't. My
program allows XL97-XP so I want to program for XL97. However, when I use
the following in XL97

Sub ZapHyperlink()
ActiveSheet.Hyperlinks.Delete
End Sub

it reformats the font and borders in cell. It shouldn't. I can include
lengthy reformatting procedures to sub, but prefer not to. Does anyone have
a suggestion how to cleanly deal with this?

Thank you in advance. Jim Kobzeff

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
LEN function in XL97 Brian Excel Discussion (Misc queries) 5 May 19th 06 06:39 PM
Custom toolbar xl97 Nigel Excel Programming 0 April 9th 05 10:19 AM
xl97 and Worksheet_Change event ? Greg Wilson[_3_] Excel Programming 1 September 10th 03 04:17 AM
UDF returns #value in XL97 Clark B Excel Programming 0 August 4th 03 01:39 PM


All times are GMT +1. The time now is 07:10 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"