Hyperlink to folder, but it opens in Explorer multipane view

jase

Board Regular
Joined
Nov 4, 2002
Messages
62
I have an icon on a spreadsheet that takes the user to a folder (typical URL/Hyperlink stuff in Excel -- no biggie). The frustration is that it opens the folder in Explorer two-pane view, and for simplicity (and aesthetics) I really want it to open the folder in a simple "My Computer" kinda view.

Is there a way, or is Excel limited in this regard?

I tried using switches ( ex. http://www.onecomputerguy.com/app_info/explorer_switch.htm ) but I'm not sure this works in Excel -- I couldn't get it.

Any ideas???

Thanks to all.

Jase.
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Try something like this :-
Code:
retval = Shell("explorer.exe c:\temp", vbNormalFocus)
 
Upvote 0
Spaces ?

Hi,

I'm trying to use the code above to open a folder in an explorer view, but as the folder i'm trying to open has spaces in it's name (e.g. S:\My Work File) it won't work...I get the error message "The path does not exist or is not a directory".

If I remove the spaces (i.e. S:\MyWorkFile) it works.

However, the folder is a centrally used one in my company and canot be renamed as it will affect loads of other peoples spreadsheets.

Any ideas how I can get this to work without changing the folder name?

Thanks.
 
Upvote 0
Sorry, I cannot reproduce the problem. This works for me :-
retval = Shell("explorer.exe H:\temp\test folder", vbNormalFocus)
and, with the extra backslash :-
retval = Shell("explorer.exe H:\temp\test folder\", vbNormalFocus)

Why do you want to open the folder ? If it is to open a file you could use GetOpenFileName.
 
Upvote 0
How do I use the code?

Sorry, but I don't know how to use the above code. Would someone explain.

Again, I just have a small image (icon) on a worksheet that when clicked by the user, opens up a folder on the server. Assigning a URL to the image works, but it opens up in Windows Explorer (double pane) view -- and since the folder is deeply embedded on a huge server, it is all quite messy. I just want the folder to open up in a simple "My Computer" type window without all the cascading directories.

Anyway, can someone tell me what to do with the code Brian posted. Thanks for the help.

Jase.
 
Upvote 0
In Excel Alt+F11 to get a macro module.
Copy & paste the code below.
Go to worksheet and insert a picture or shape or whatever.
Right click the picture and Assign Macro.
Code:
Sub OpenFolder()
    retval = Shell("explorer.exe C:\temp\test folder", vbNormalFocus)
End Sub
 
Upvote 0

Forum statistics

Threads
1,203,485
Messages
6,055,688
Members
444,807
Latest member
RustyExcel

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