Hyperlink to folder not working

Dunk4Divin

New Member
Joined
Aug 21, 2019
Messages
16
Office Version
  1. 365
Platform
  1. Windows
Hi

I am trying to place a hyperlink into a folder into a cell. The code below works, it looks like a hyperlink, the address when hovered over is correct but it doesn't work. I have code for file hyperlink to file and that works so there is no issue with the cell format or the workbook. So I have hit brick wall in terms of ideas.... anybody who can help please?

Sub SelectFolder()

Dim FldrPicker As FileDialog
Dim myFolder As String, cel As Range
Set cel = Range("H10")

Set FldrPicker = Application.FileDialog(msoFileDialogFolderPicker)

With FldrPicker
.Title = "Select A Target Folder"
.AllowMultiSelect = False
If .Show <> -1 Then Exit Sub 'Check if user clicked cancel button
myFolder = .SelectedItems(1)
End With

cel.Hyperlinks.Add Anchor:=cel, Address:=fPath, TextToDisplay:=myFolder
End Sub

Thanks very much
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.

Forum statistics

Threads
1,223,243
Messages
6,170,971
Members
452,371
Latest member
Frana

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