VBA Hyper link - 255 Character Limit issue!

TTUK

Board Regular
Joined
Apr 5, 2012
Messages
137
Hi all,

My code is:
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)


Dim fd As FileDialog
    
    If Target.Count > 1 Then Exit Sub
    If Target.Column = 9 And Target.Row > 5 And Target.Row < 3000 Then
    If Target.Hyperlinks.Count = 0 Then
        Set fd = Application.FileDialog(msoFileDialogFilePicker)
        With fd
            .InitialFileName = ""
            .InitialView = msoFileDialogViewList
            .AllowMultiSelect = False
            .title = "Insert Hyperlink"
            If .Show <> 0 Then ActiveSheet.Hyperlinks.Add Anchor:=Target, Address:=.SelectedItems(1), TextToDisplay:="Link to File"
    End With
    End If
    End If
End Sub

My file path for example could be for example:
\\vsrv010\SHARED\00 B.O.S\Formal Index\# Department Controls\7. Human Resources (HR)\3. Forms (FO)\FO-08_New Starter Personal Details Form.doc

But when I click the hyperlink it only goes so far, and opens up a folder location. It won't open the specific file.

Is there any way I can get around this?!
Look forward to your support!

Regards, TTUK
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.

Forum statistics

Threads
1,216,434
Messages
6,130,597
Members
449,584
Latest member
c_clark

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top