Hi Friends,
can you pls help me out with the code which can hyperlink the active cell value mentioned in the sheet,and open that folder and its file whichever i will choose to open from it. My code is doing upto 70% of the task, but unable to open the choosing file from it. It throws the error as : " object required."
It is highly appreciated if you can guide me in this regards,
Thanks, and Best regards,
The code is as mentioned below:
<code style="margin: 0px; padding: 0px; font-style: inherit; font-weight: inherit; line-height: 12px;">Sub opendfiles()
Dim myfile As Variant
Dim Counter As Integer
Dim path As String
MyFolder = "C:\backup" & ActiveCell.Value & ""
ChDir MyFolder
myfile = Application.GetOpenFilename(, , , , True)
Counter = 1
If IsNumeric(myfile) = True Then
MsgBox "No files selected"
End If
While Counter <= UBound(myfile)
path = myfile(Counter)
fso.MyFolder.Open path
Counter = Counter + 1
Wend
End Sub</code>
can you pls help me out with the code which can hyperlink the active cell value mentioned in the sheet,and open that folder and its file whichever i will choose to open from it. My code is doing upto 70% of the task, but unable to open the choosing file from it. It throws the error as : " object required."
It is highly appreciated if you can guide me in this regards,
Thanks, and Best regards,
The code is as mentioned below:
<code style="margin: 0px; padding: 0px; font-style: inherit; font-weight: inherit; line-height: 12px;">Sub opendfiles()
Dim myfile As Variant
Dim Counter As Integer
Dim path As String
MyFolder = "C:\backup" & ActiveCell.Value & ""
ChDir MyFolder
myfile = Application.GetOpenFilename(, , , , True)
Counter = 1
If IsNumeric(myfile) = True Then
MsgBox "No files selected"
End If
While Counter <= UBound(myfile)
path = myfile(Counter)
fso.MyFolder.Open path
Counter = Counter + 1
Wend
End Sub</code>