Results 1 to 8 of 8

Thread: Shelly

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 2000
    Posts
    247
    How come this work

    Call Shell("Notepad", vbNormal)

    and this doesn't?

    Call Shell("Excel", vbNormal)

    Any other way to open excel?
    Mako Shark
    Great White

  2. #2
    Fanatic Member RealisticGraphics's Avatar
    Join Date
    Jul 1999
    Location
    Arkansas
    Posts
    655
    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

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    May 2000
    Posts
    247
    That is my question RealisticGraphics. Why can I shell notepad without a path but shelling excel requires a path?
    Mako Shark
    Great White

  4. #4
    New Member
    Join Date
    Nov 2000
    Location
    US of A
    Posts
    5
    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.

  5. #5
    Guest
    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.

  6. #6
    Addicted Member Rudy's Avatar
    Join Date
    Sep 2000
    Location
    BC, Canada
    Posts
    198
    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

  7. #7
    Fanatic Member
    Join Date
    Feb 2000
    Location
    The Netherlands
    Posts
    715
    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
    Code:
    PATH C:\windows
    is in your autoexec.bat

    If you put myprog.exe in c:\mydir and add this to autoexec.bat
    Code:
    PATH C:\mydir
    Then, you can also use
    Code:
    Shell "Myprog.exe"
    Oetje
    oetje@home.nl
    93606776
    Visual Basic 6, Windows 2000

    Never pet a burning dog

  8. #8

    Thread Starter
    Addicted Member
    Join Date
    May 2000
    Posts
    247
    Thank you all who replied.

    oetje: What if I put the this, can I use all sub level?

    Path C:\
    Mako Shark
    Great White

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width