Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 141
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel won't highlight selected cells David K.[_2_] Excel Discussion (Misc queries) 2 March 3rd 10 03:54 PM
How can I make an Excel file selected in Explorer open automatica. jddugan Excel Discussion (Misc queries) 1 December 29th 09 10:40 PM
How do I get Excel 2007 to highlight the cells I've selected? michael0511 Excel Discussion (Misc queries) 4 December 17th 08 09:22 PM
highlight selected cells in excel and blackout others for sharing Brian Pruett Excel Worksheet Functions 4 April 7th 08 12:42 PM
Excel 2007 doesn't open files selected using Explorer or Recent Do Kurt Excel Discussion (Misc queries) 0 January 31st 07 07:51 PM


All times are GMT +1. The time now is 02:01 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"