Results 1 to 14 of 14

Run command in cmd.exe using the string from a particular cell

Threaded View

  1. #1
    Registered User
    Join Date
    08-02-2012
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    7

    Run command in cmd.exe using the string from a particular cell

    So basically guys I have this command string in cell E26 which gets generated by the changing values in the cells E9, E11 & E12.

    C:\software license\License.exe Evaluation 30


    All I need to do is Run this string which is in cell E26 in cmd.exe using a macro. I cannot figure out how to? I am trying different VBA's but all it doing is opening the cmd and not executing it.

    If possible please help me with two different VBA's:
    1) Running string in CMD silent mode.
    2) Running string in CMD with CMD window open.

    __________________________________

    Cell Values:-
    E9 = File path name
    E11 = Evaluation\Annual\Perpetual
    E12 = 30\365\730 (Days)

    Formula in E26 is:-
    =E9&" "&E11&" "&E12

    ---------- Post added at 10:00 AM ---------- Previous post was at 09:54 AM ----------

    Any changes which you would recommend in this?

    Sub Run.command()
         
         
        Dim Par As String
        Par = Range("E26")
        Call Shell("C:\WINDOWS\system32\cmd.exe /c " & Par, 1)
         
    End Sub
    Last edited by smasher007; 08-30-2012 at 12:08 PM.

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