Hello,
I am trying to use the Shell command and it won't start any command line windows. When I run this
nothing happens and all I get is retval =2644. I don't see the command line Window.retval = Shell("c:\WINDOWS\system32\cmd.exe", vbMaximizedFocus)
Windows applications like this one work fine and open a Calculator window.
What am I to do?retval = Shell("calc.exe", vbNormalFocus)
Thanks!
Arijit
Last edited by royUK; 04-05-2010 at 02:32 PM.
Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here
I have added them this time
Hope that helps.
RoyUK
--------
If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need
For Excel Tips & Solutions, free examples and tutorials why not check out my downloads
New members please read & follow the Forum Rules
Remember to mark your questions Solved and rate the answer(s)
Your code works for me
Public Sub X() On Error GoTo errTrap: retval = Shell("c:\WINDOWS\system32\cmd.exe", vbMaximizedFocus) Exit Sub errTrap: MsgBox "Could not open cmd.exe.", vbExclamation + vbOKOnly, Title End Sub
Hope that helps.
RoyUK
--------
If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need
For Excel Tips & Solutions, free examples and tutorials why not check out my downloads
New members please read & follow the Forum Rules
Remember to mark your questions Solved and rate the answer(s)
Hey arijit32,
The original code produces "error 76: path not found" for me. Though I am on a corporate computer.
This works for me just fine though:
I am sure RoyUK's code works like a charm too!retval = Shell("cmd.exe", vbMaximizedFocus)
Warm regards,
Shampoo Monkey
If you are happy with the results, please add to my reputation by clicking the icon next to the Post # in the bar above this post.
That's the problem, I don't see any command line window coming up and no error either. It works fine on my friends' machines too.
Then I would think that the problem is with your computer
Hope that helps.
RoyUK
--------
If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need
For Excel Tips & Solutions, free examples and tutorials why not check out my downloads
New members please read & follow the Forum Rules
Remember to mark your questions Solved and rate the answer(s)
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks