+ Reply to Thread
Results 1 to 5 of 5

How To Add Shortcuts To My Existing Macro

  1. #1
    Valued Forum Contributor
    Join Date
    09-04-2007
    Location
    Ontario, Ca
    Posts
    624

    How To Add Shortcuts To My Existing Macro

    I have a routine that by clicking one button, that calls a macro, that currently opens Excel, or Word, or WordPerfect. The following macro uses a Case Statement looking at what the extension is, such as for Excel . . . xls

    I have added a case statement for a shortcut . . . exe


    This 1st macro works perfect


    Please Login or Register  to view this content.
    When the Case "exe" is encountered, it calls the below macro that I have copied from my macro that opens excel.

    My problem is that I do not know how to change the code in the following macro below the row of XXXXXXXXXXXXXXXXXXXX. I want those lines to open C:\Program Files\McAfee\MSC\mcshell.exe not Excel. With the correct code changes in the lines below the XXXXXXXXXXXX's, it should work.


    Please Login or Register  to view this content.

    Certainly hope one of you out there can assist me. Leith Ross has helped me so much with my difficult coding, l would like to give him a break and hopefully someone else can assist me. Thanks Leith.
    Last edited by Launchnet; 04-28-2009 at 03:01 PM.
    Thanks for helping . . .
    Matt @ Launchnet

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: How To Add Shortcuts To My Existing Macro

    Hello Matt,

    You can launch the program using the Shell command. One call, that's it.
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Valued Forum Contributor
    Join Date
    09-04-2007
    Location
    Ontario, Ca
    Posts
    624

    Re: How To Add Shortcuts To My Existing Macro

    Good Morning Leith . . .

    Where would I be without you.

    My current path is:

    Please Login or Register  to view this content.
    When I test it I get:

    Compile error:
    Syntax error

    And the code line . . . Shell(c1, 1) is high-lited in red.

    Can you please tell me what I am doing wrong. This exe is just one of the examples that I took off of my desktop to test with.

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: How To Add Shortcuts To My Existing Macro

    Hello Matt,

    Sorry, I was in hurry. Remove the parentheses.
    Please Login or Register  to view this content.

  5. #5
    Valued Forum Contributor
    Join Date
    09-04-2007
    Location
    Ontario, Ca
    Posts
    624

    Re: How To Add Shortcuts To My Existing Macro

    Just got back. It works perfect. We have a good macro here.

    Earlier I sent you a priviate email - when you have time to read.

    Will mark this as solved

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1