Open hyperlink from VBA code
Hi,
Using the following code, I can assign a hyperlink to a cell, and then use the "follow" method to open that file.
Code:
MyRange = Target.Address
Worksheets(1).Hyperlinks.Add Range(MyRange), MyPth 'Full path to file
On Error Resume Next
Target.Hyperlinks(1).Follow
I want to accomplish this without using a spreadsheet object. ie, use an object within the code itself eg
Code:
Dim MyObj as Hyperlink
Set MyObj = MyPth 'Full path to file
MyObj.follow
Any suggestions?
MD