Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Intra-workbook hyperlink: macro/function to return to hyperlink ce | Excel Discussion (Misc queries) | |||
Macro to Copy Hyperlink to another file as a HYPERLINK, not text... | Excel Programming | |||
How can I pass an array as TextToDisplay to a hyperlink? | Excel Programming | |||
Hyperlink TexttoDisplay | Excel Programming | |||
reading html when hyperlink address not hyperlink text diplayed | Excel Programming |