How come this work
Call Shell("Notepad", vbNormal)
and this doesn't?
Call Shell("Excel", vbNormal)
Any other way to open excel?
Printable View
How come this work
Call Shell("Notepad", vbNormal)
and this doesn't?
Call Shell("Excel", vbNormal)
Any other way to open excel?
To shell excel in that manner you'd have to know the path to the excel exe, which you can pull from the registry. Notepad can be open because windows recognizes the path automatically in the same way as if you go to run regedit.
That is my question RealisticGraphics. Why can I shell notepad without a path but shelling excel requires a path?
shell gets the default path if the path is not specified. Here try this. Anything that you can type in the "run" menu and it runs won't require a path. For example try "command" on the run menu. It should work. I don't know the internals of this behavior other then this is due to windows folder intialization at startup.
Basically, you can run anything in C:\Windows\ without specifying a path. Most of the main stuff anyway.
Calculator, Notepad, Wordpad, Paint, CDPlayer, etc. etc.
Any other file and you have to specify the path.
hum....weird im running windows 2000 ( maybe it's specific to that OS ) and when i type "excel" in run well excel start, i haven't tried to use it in VB though, btw i have Office 2k and it's installed to the default directory if it can help
It's because this lineQuote:
Originally posted by Shark
That is my question RealisticGraphics. Why can I shell notepad without a path but shelling excel requires a path?
is in your autoexec.batCode:PATH C:\windows
If you put myprog.exe in c:\mydir and add this to autoexec.bat
Then, you can also useCode:PATH C:\mydir
Code:Shell "Myprog.exe"
Thank you all who replied.
oetje: What if I put the this, can I use all sub level?
Path C:\