|
-
Nov 20th, 2000, 07:39 PM
#1
Thread Starter
Addicted Member
How come this work
Call Shell("Notepad", vbNormal)
and this doesn't?
Call Shell("Excel", vbNormal)
Any other way to open excel?
-
Nov 20th, 2000, 07:43 PM
#2
Fanatic Member
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.
www.RealisticGraphics.net
Running VS.Net Enterprise & VB 6
Other Languages: JavaScript, VBScript, VBA, HTML, CSS, ASP, SQL, XML
MSN Messenger: kmsheff
-
Nov 20th, 2000, 07:45 PM
#3
Thread Starter
Addicted Member
That is my question RealisticGraphics. Why can I shell notepad without a path but shelling excel requires a path?
-
Nov 20th, 2000, 08:04 PM
#4
New Member
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.
-
Nov 20th, 2000, 09:06 PM
#5
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.
-
Nov 22nd, 2000, 02:19 AM
#6
Addicted Member
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
*Rudy^
Visual Studio 6 Ent. SP5
Windows 2000 SP4
Windows XP SP1a
-
Nov 22nd, 2000, 02:40 AM
#7
Fanatic Member
Originally posted by Shark
That is my question RealisticGraphics. Why can I shell notepad without a path but shelling excel requires a path?
It's because this line
is in your autoexec.bat
If you put myprog.exe in c:\mydir and add this to autoexec.bat
Then, you can also use
-
Nov 22nd, 2000, 05:09 AM
#8
Thread Starter
Addicted Member
Thank you all who replied.
oetje: What if I put the this, can I use all sub level?
Path C:\
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|