I'm trying to create a hyperlink in one Workbook to open a second workbook. As part of the code i have the follwoing lines:
strFileName = "SmithJobDesc.xls"
Activesheet.Hyperlink.Add Anchor:=Selection,Address=strFileName,TestToDisplay="Position"
When the code is run a hyperlink is created in one workbook.
I moved the two workbooks to a folder on another user's machine (one workbook with the hyperlink and the other to be opened by it) and click the hyperlink I get the message "the address of the site is not valid". when I check the address in Excel (Edit Hyperlink) the address displayed is ../SmithJobDesc.xls
When I set up a parent directory and place one workbook in it the Hyperlink works. My goal is to keep both files in the same folder. How do I modify the VBA code so the ../ is not part of the Hyperlink address.
Thanks
Roy
strFileName = "SmithJobDesc.xls"
Activesheet.Hyperlink.Add Anchor:=Selection,Address=strFileName,TestToDisplay="Position"
When the code is run a hyperlink is created in one workbook.
I moved the two workbooks to a folder on another user's machine (one workbook with the hyperlink and the other to be opened by it) and click the hyperlink I get the message "the address of the site is not valid". when I check the address in Excel (Edit Hyperlink) the address displayed is ../SmithJobDesc.xls
When I set up a parent directory and place one workbook in it the Hyperlink works. My goal is to keep both files in the same folder. How do I modify the VBA code so the ../ is not part of the Hyperlink address.
Thanks
Roy