LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default Leading zero in hyperlink TextToDisplay

Hello

I have a macro that allows the user to insert a hyperlink to a pdf
file. The macro allows them to browse to a pdf file, click on it and
the link will be inserted. This seemed to be working fine until Excel
2003.

The pdf files are numbered, and may have leading zeroes (names are all
seven characters long).

Following are some fragments of my macro:

Sub CreateHyperlink()
Dim FName As String, DispName As String
'
Code to extract filename from full path and remove .pdf
'
'
' Create the hyperlink
'
ActiveSheet.Hyperlinks.Add Anchor:=ActiveCell, _
Address:=FName, TextToDisplay:=DispName
End Sub

If I "watch" the DispName variable, the code works correctly and it has
a seven digit value (such as 0654321). However, when inserted in the
spreadsheet the hyperlink drops the leading zero and displays 654321.
I've tried various formatting options. If I (via the macro) put an
apostrophe in front of DispName it shows up correctly (eg
TextToDisplay:="'" & DispName), but then the XL2003 error checking
kicks in and I get little green triangles everywhere.

Can anyone suggest what might have changed between 2000 and 2003, and
more importantly how I can prevent it from dropping the leading zeroes?

Thanks

Murray

 
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
Intra-workbook hyperlink: macro/function to return to hyperlink ce marika1981 Excel Discussion (Misc queries) 3 May 6th 05 05:47 AM
Macro to Copy Hyperlink to another file as a HYPERLINK, not text... dollardoc Excel Programming 1 April 7th 05 12:47 AM
How can I pass an array as TextToDisplay to a hyperlink? Jay Fincannon Excel Programming 4 January 28th 05 01:45 AM
Hyperlink TexttoDisplay James[_32_] Excel Programming 5 September 27th 04 01:59 PM
reading html when hyperlink address not hyperlink text diplayed Kevin Excel Programming 1 December 4th 03 10:13 PM


All times are GMT +1. The time now is 05:38 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"