Consulting

Results 1 to 3 of 3

Thread: Solved: Start another application using VBA?

  1. #1
    VBAX Regular andrew93's Avatar
    Joined
    Aug 2005
    Location
    Auckland, New Zealand
    Posts
    68
    Location

    Solved: Start another application using VBA?

    Hi

    I've searched this and the tek-tips forum and am not having much luck. I want to start an application called "ClickYes.exe" using VBA within an Access database but I don't necessarily know which of my users directories it is located in.

    The Shell command works ok if I use the full path on my PC, like this :

    Shell ("C:\Program Files\ExpressClickYes\ClickYes.exe")

    This works fine, but as I said, my users won't necessarily have this application loaded in the same directory.

    How can I detect which directory this application is loaded in so I can amend my Shell statement? Or is there another way of starting this application that doesn't involve excessive coding?

    TIA, Andrew

    {You may ask "Why?" This is part of a much larger process in Access where the user creates a document / report and e-mails a pdf version to their client, and this software temporarily suppresses the outlook alert for automated e-mails. Given this software could be harmful in the wrong hands, I don't want this software running all the time - only when the user needs to use it for sending an e-mail from the database).
    Last edited by andrew93; 12-22-2005 at 03:01 AM. Reason: clarity

  2. #2
    VBAX Master Killian's Avatar
    Joined
    Nov 2004
    Location
    London
    Posts
    1,132
    Location
    Hi Andrew,

    Ideally, the installation of ClickYes.exe would do something useful like set a registry value with it's path that you could check.

    If that is not the case it looks like you have 2 options:
    1) Prompt the user to locate it for you with a browse dialog.
    2) Search the entire local drive for it

    The search doesn't really seem feasible - bear in mind that it could be saved in a network location.

    I would suggest:
    1) Try a default path first (like "C:\Program Files\ExpressClickYes\")
    2) If that fails, prompt for a user-specified path
    3) Confirm the path and save to the registry (so this process only has to happen once)
    K :-)

  3. #3
    VBAX Regular andrew93's Avatar
    Joined
    Aug 2005
    Location
    Auckland, New Zealand
    Posts
    68
    Location
    Unfortunately there isn't a standard registry entry & I don't fanvy searching all available drives so I will give your other suggestions a go.
    Thanks very much for the suggestions.
    Andrew
    Last edited by andrew93; 12-22-2005 at 03:19 PM.

Posting Permissions

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