Results 1 to 6 of 6
  1. #1
    Silver Lounger
    Join Date
    Dec 2000
    Location
    California, USA
    Posts
    1,758
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Run Desktop Shortcut (XL97;SR2)

    Is it possible to run or should I say envoke a desktop shortcut from within VBA code? If so, what would the code look like.

    Thanks,
    John

  2. #2
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Vienna, Wien, Austria
    Posts
    5,009
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Run Desktop Shortcut (XL97;SR2)

    Could you be a bit more specific why you need to access the Desktop Shortcut and not the FilePath? If there is something involving a Command Line Switch, perhaps we can do something with the Microsoft Scripting Runtime.
    Gre

  3. #3
    Silver Lounger
    Join Date
    Dec 2000
    Location
    California, USA
    Posts
    1,758
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Run Desktop Shortcut (XL97;SR2)

    I currently have a shortcut that envokes an EXE file and passes the userid/password to the application. I simply have to double-click on the shortcut and walk away.

    I'm not familiar with MSoft Scripting Runtime.

    John

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Run Desktop Shortcut (XL97;SR2)

    I can't remember - does the Workbook object in Excel 97 VBA have a FollowHyperlink method? If so, you could use the following:

    ActiveWorkbook.FollowHyperlink "path-to-desktopname-of-shortcut.lnk"

    Where you must substitute the path to your desktop and the name of the shortcut. The path to the desktop depends on your operating system.

  5. #5
    Silver Lounger
    Join Date
    Dec 2000
    Location
    California, USA
    Posts
    1,758
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Run Desktop Shortcut (XL97;SR2)

    Hans,

    XL97 does have the "ActiveWorkbook.FollowHyperlink "path-to-desktopname-of-shortcut.lnk".

    I'll give it a try.

    Thanks,
    John

  6. #6
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: Run Desktop Shortcut (XL97;SR2)

    Just to confirm for you Hans:
    YES excel97 VB has the FollowHyperlink Method for a Workbook object.

    Steve

Posting Permissions

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