Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Highlight Selected Excel file in Explorer
Hi Reader
Do you know how to higlight selected Excel file in Explorer ? Sub APOpen_FileLocation() Dim objFSO, objShell, strDir, strName strDir = ActiveWorkbook.Path strName = ActiveWorkbook.FullName On Error Resume Next 'MsgBox strDir Set objFSO = CreateObject("Scripting.FileSystemObject") strDir = objFSO.getFolder(strDir) If Err.Number = vbEmpty Then Set objShell = CreateObject("WScript.shell") objShell.Run ("Explorer" & " " & strDir) '~~ Highlight Selected Excel file in explorer End If Set objFSO = Nothing Set objShell = Nothing Set strDir = Nothing End Sub |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Highlight Selected Excel file in Explorer
Hi Moonhk,
You were very close. Sub APOpen_FileLocation() Dim objShell As Object, strName As String strName = ActiveWorkbook.FullName On Error Resume Next If Err.Number = vbEmpty Then Set objShell = CreateObject("WScript.shell") objShell.Run ("Explorer /select," & strName) End If Set objShell = Nothing Set strDir = Nothing End Sub Cheers, Ivan. On Apr 1, 6:33*pm, moonhk wrote: Hi Reader Do you know how to higlight selected Excel file in Explorer ? Sub APOpen_FileLocation() Dim objFSO, objShell, strDir, strName * *strDir = ActiveWorkbook.Path * *strName = ActiveWorkbook.FullName * *On Error Resume Next * *'MsgBox strDir * * Set objFSO = CreateObject("Scripting.FileSystemObject") * * strDir = objFSO.getFolder(strDir) * * If Err.Number = vbEmpty Then * * * * Set objShell = CreateObject("WScript.shell") * * * * objShell.Run ("Explorer" & " " & strDir) * * * * '~~ Highlight Selected Excel file in explorer * * End If * * Set objFSO = Nothing * * Set objShell = Nothing * * Set strDir = Nothing End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel won't highlight selected cells | Excel Discussion (Misc queries) | |||
How can I make an Excel file selected in Explorer open automatica. | Excel Discussion (Misc queries) | |||
How do I get Excel 2007 to highlight the cells I've selected? | Excel Discussion (Misc queries) | |||
highlight selected cells in excel and blackout others for sharing | Excel Worksheet Functions | |||
Excel 2007 doesn't open files selected using Explorer or Recent Do | Excel Discussion (Misc queries) |