Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can i link excel sheet to a file Explorer

Status
Not open for further replies.

Geokakis

Technical User
Jan 26, 2003
8
DE
Good day to you all out there. Please, can someone advice me how i can link up to a file in window explorer from an excel sheet with only a click on a particular cell.

Some Written code will be very helpful !!!

Thanks

Geo
 
pls explain "link"
If you just want to open the file, just use Insert>Hyperlink - no code needed. anything else will need to be explained further

ps - it is always appreciated if someone has made a stab at creating their own code BEFORE asking for help here - saying
"some written code will be very helpful", whether you mean it to or not, suggests to me that you have been asked to do something and before even trying it, you are asking for a complete (free) solution Rgds
Geoff

Vah! Denuone Latine loquebar? Me ineptum. Interdum modo elabitur
 
**** The program below is what i wrote for different functions on the excel sheet. But in this case i wanted to know what i should do to enable me call a related file that is saved in window explorer from the excel sheet by clicking on aspecific cell on this sheet****



Private currRow As Integer
Private currCol As Integer
Private oldValue As Variant
Private inWorkSheetChange As Boolean

Private Sub Worksheet_Change(ByVal Target As Range)
Dim newValue As Variant
Dim colLastUpdate As Integer

If currCol = ActiveSheet.[LASTUPDATE].Column Then
inWorkSheetChange = False
Exit Sub
End If

If inWorkSheetChange Then
inWorkSheetChange = False
Exit Sub
End If

inWorkSheetChange = True

colLastUpdate = ActiveSheet.[LASTUPDATE].Column
ActiveSheet.Cells(currRow, colLastUpdate).Value = Date
inWorkSheetChange = True

If currRow > (ActiveSheet.[lastRow].Row - 2) Then
inWorkSheetChange = False
Exit Sub
End If

newValue = Cells(currRow, currCol).Value
dataName = Cells(ActiveSheet.[LASTUPDATE].Row, currCol).Value

UserForm_Changecomment.currRow = currRow
UserForm_Changecomment.currCol = currCol
UserForm_Changecomment.oldValue = oldValue
UserForm_Changecomment.newValue = newValue
UserForm_Changecomment.dataName = dataName
UserForm_Changecomment.Show

If UserForm_Changecomment.changeDone = True Then

With Cells(currRow, currCol)
.Font.ColorIndex = 3
.Font.Bold = True
.Interior.ColorIndex = 6
.Interior.Pattern = xlSolid
End With

End If


inWorkSheetChange = False
End Sub



Private Sub Worksheet_SelectionChange(ByVal Target As Range)

inWorkSheetChange = False
currRow = ActiveCell.Row
currCol = ActiveCell.Column
oldValue = ActiveCell.Value
End Sub

 
Hi Geo

You can insert a hyperlink to explorer.exe but I cannot make it open the correct folder. You can usually add extensions onto executable file paths to do things like that, but I cannot make it work with explorer.

Sorry I can't be any more help.

Tom

ps. If you did this with code, then you would probably end up having to use the very "hit and miss" SendKeys function to force explorer to "browse" to the correct folder.
 
Sorry - we posted at a similar time. I thought you were asking to link to explorer, which from your latter post appears incorrect.

I'm afraid I don't actually understand what you are asking any more!

Tom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top