|
|
|
|
|
|
Multiple Apps
|
Browse the folder of your active document or workbook
|
|
Ease of Use
|
Easy
|
Version tested with
|
2003
|
Submitted by:
|
mdmackillop
|
Description:
|
Opens the folder which contains your current open file
|
Discussion:
|
I often need to open a related file to that where I'm working. This single line code simplifies the operation.
|
Code:
|
instructions for use
|
Option Explicit
Sub ExplorePath()
Shell Environ("windir") & "\Explorer.exe " & ActiveDocument.Path, vbMaximizedFocus
End Sub
Option Explicit
Sub ExplorePath()
Shell Environ("windir") & "\Explorer.exe " & ActiveWorkbook.Path, vbMaximizedFocus
End Sub
|
How to use:
|
- Copy above code.
- Press Alt + F11 to enter the VBE.
- Press Ctrl + R to show the Project Explorer.
- Select desired file on left (in bold).
- If desired all the time, use Personal or Normal as appropriate.
- Choose Insert | Module.
- Paste code into the right pane.
- Click File | Save.
- Press Alt + Q to close the VBE.
|
Test the code:
|
- Open Word or Excel file from the sample and save in a suitable folder.
- Press Alt + F8, select the ExplorePath macro and click on Run
- or, in the sample files, click the button.
|
Sample File:
|
Samples.zip 13.77KB
|
Approved by mdmackillop
|
This entry has been viewed 159 times.
|
|