How to Open a folder in windows explorer with Excel vba

Turbo613

Board Regular
Joined
Mar 2, 2007
Messages
134
I'm sure this is really easy, but I'm learning and not having luck in the search option for previous posts. Thanks for your patience in advance.

I want to open a windows explorer window by using a button in Excel.

Any ideas?

Thanks Turbo!
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
You can assign the following code to a button:

Code:
Sub OpenExplorer()
    Dim x
    x = Shell("explorer", 1)
End Sub
 
Upvote 0
Thanks for the replies, I was able to make this work as well, but it comes up in big icons and I would like the view to be in list view.

Private Sub Open_1day_CMS_Download_Folder()

Dim IE As Object
Set IE = CreateObject("internetexplorer.application")
IE.Navigate "\\its\gwh\grphome\Operations and Support\Rpt & Analysis\Daily Call Service Reports\2007\Avaya 1 day download"
IE.Visible = True

Exit Sub

End Sub
 
Upvote 0
HI, when you say use this code, I have a question; where do you insert your path, for example: how would it look if I wanted to open this file? C:\Documents and Settings\mlbo\Desktop



You can assign the following code to a button:

Code:

Sub OpenExplorer()
Dim x
x = Shell("explorer", 1)
End Sub
 
Upvote 0
Sorry I didn't read the question properly - I thought that you simply wanted to launch Windows Explorer from Excel.
 
Upvote 0
I missed that too.
Liked it better when Microsoft called it "File Manager". Less confusing.
 
Upvote 0
Try this.
Code:
Sub OpenExplorer()
Dim x
x = Shell("explorer /n,/e,C:\Documents and Settings\mlbo\Desktop", 1)
End Sub
 
Upvote 0
Perfect! Thanks for teaching a newbie.

Question1, is there something in this code that specifies the view of the opening folder, what does this code below from your suggestion do?

/n,/e,

Question2, is there a way to have the window maximize?
 
Upvote 0

Forum statistics

Threads
1,213,506
Messages
6,114,025
Members
448,543
Latest member
MartinLarkin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top