469,338 Members | 8,076 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,338 developers. It's quick & easy.

Using call shell to open a specified folder

4
Hi
Am using
Expand|Select|Wrap|Line Numbers
  1. Call Shell("explorer.exe c:\", vbNormalFocus)
this works fine however i have the folder location stored in a txt field and would like the button to retrieve that location

Expand|Select|Wrap|Line Numbers
  1. Private Sub cmdShortcut_Click()
  2.     Dim strShortcut As String
  3.     strShortcut = Me.txtShortcut
  4.  
  5.     Call Shell("explorer.exe" & strShortcut, vbNormalFocus)
  6. End Sub
tried this but not working, says path not found although copy pasting the path works.
I tried to use hyperlinks and they didnt work either.
any ideas greatly appreciated. j
Jan 4 '07 #1
4 15447
JonniP
4
just to clarify the path i copy and paste is the one in "txtshortcut"
Jan 4 '07 #2
ADezii
8,800 Expert 8TB
Hi
Am using
Expand|Select|Wrap|Line Numbers
  1. Call Shell("explorer.exe c:\", vbNormalFocus)
this works fine however i have the folder location stored in a txt field and would like the button to retrieve that location

Expand|Select|Wrap|Line Numbers
  1. Private Sub cmdShortcut_Click()
  2.     Dim strShortcut As String
  3.     strShortcut = Me.txtShortcut
  4.  
  5.     Call Shell("explorer.exe" & strShortcut, vbNormalFocus)
  6. End Sub
tried this but not working, says path not found although copy pasting the path works.
I tried to use hyperlinks and they didnt work either.
any ideas greatly appreciated. j
This will work fine, you simply needed a space after explorer.exe:
Expand|Select|Wrap|Line Numbers
  1. Dim retVal
  2. retVal = Shell("explorer.exe " & Me![txtShortcut], vbNormalFocus)
Jan 4 '07 #3
JonniP
4
Cheers! i feel so stupid now!
Thanks again
Jan 5 '07 #4
NeoPa
32,182 Expert Mod 16PB
LMAO.
But we've all done that Jonni.
The important thing is that you're sorted :)
Jan 7 '07 #5

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by Yuri Vorontsov | last post: by
4 posts views Thread by santel_helvis | last post: by
9 posts views Thread by Amjad | last post: by
2 posts views Thread by JirkaJ | last post: by
2 posts views Thread by Lobb[cz] | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by Purva khokhar | last post: by
1 post views Thread by haryvincent176 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.