Need help using a relative path in VBA

Apr 5, 2017
Reaction score
Hello everyone, I am currently using excel 2016 and am very new to VBA. I have a very simple program which entails when a button is clicked it will pull up the manual for the tool. I have it working when i use an absolute path. Problem is when other co workers need to use this excel sheet we dont have the network that we share defined the same. Mine is X: while another co workers is Z: hence needing relative paths. This is my code so far i am wondering what needs to change to make it a relative path.

Private Sub Dewalt_Angle_Grinder_Click()

intMessage = MsgBox("Do you want to see the Dewalt_Angle_Grinder_Click?", vbYesNo, "manuals")

If intMessage = vbYes Then

ThisWorkbook.FollowHyperlink "X:\Tools\Tool Manuals\dw818.pdf"

End If
intMessage = vbNo
End Sub

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question