472,117 Members | 2,667 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,117 software developers and data experts.

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 15747
JonniP
4
just to clarify the path i copy and paste is the one in "txtshortcut"
Jan 4 '07 #2
ADezii
8,830 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,497 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 leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.