Hello all
==> It kinda is working BUT the error "Reference isn't valid" pops up and **2** file explorers open with the proper file selected.
My table ("tbl_active")
Table has a column (header "FullPath") with a full path and file name with the extension via a formula.
I want to click on hyperlinks running down a column in the same table... that calls VBA and opens file explorer and selects the referenced file.
BUT not open it.
Code I have:
In the excel table:
I added hyperlink in the cells of the "select" column (and excel auto populated all the rows):
=HYPERLINK("#open_folder_selfile()","SEL File")
---In VBA (module5) I have tried several ideas:
Sub open_folder_selfile()
Dim fOPath As String
fOPath = ThisWorkbook.Worksheets("Status").Range("tbl_active[FullPath]").Cells(ActiveCell.Row)
Call Shell("explorer.exe /select, " & fOPath, vbMaximizedFocus)
End Sub
AND
Sub open_folder_selfile()
Dim fOPath As String
fOPath = Sheets("Status").Range("tbl_active[FullPath]").Cells(ActiveCell.Row).Value
Call Shell("explorer.exe /select, " & fOPath, vbMaximizedFocus)
End Sub
Again this kinda is working BUT the error "Reference isn't valid" pops up and **2** file explorers open with the proper file selected.
OFFICE / Excel 365
I hope I explained this ok. Thank you!
Marc
Bookmarks