Monday, July 15, 2013

Excel Macro VBA open current file path

Sub OpenFilePath()
'Purpose: Open the path where the current workbook is saved, using window explorer
    'InputBox "Document Path", "Show DocumentPath", ActiveWorkbook.FullName
    'call window explorer
    'MsgBox ActiveWorkbook.Path
    retval = Shell("C:\WINDOWS\explorer.exe /e ,/select," & ActiveWorkbook.FullName, vbNormalFocus)
End Sub

No comments:

Post a Comment