Hi,
I,m new to VBA and started my first user form with buttons and list box, I wrote the code below to open a file in my laptop that named after the first item in the selected line in the Listbox:
Private Sub CmdFindLetter_Click()
Dim i As String
i = ListBox1.Selected(0)
ThisWorkbook.FollowHyperlink "D:\Tests\Letters\L-" + i + ".pdf"
End Sub
but I got this message (image attached)
Any solution?
I,m new to VBA and started my first user form with buttons and list box, I wrote the code below to open a file in my laptop that named after the first item in the selected line in the Listbox:
Private Sub CmdFindLetter_Click()
Dim i As String
i = ListBox1.Selected(0)
ThisWorkbook.FollowHyperlink "D:\Tests\Letters\L-" + i + ".pdf"
End Sub
but I got this message (image attached)
Any solution?