+ Reply to Thread
Results 1 to 4 of 4

Shell command in VBA ?

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    03-07-2013
    Location
    Montreal
    MS-Off Ver
    Excel 2007
    Posts
    274

    Shell command in VBA ?

    Hello,

    Okay I give up! How do we keep the black DOS command prompt window from coming up while using the shell command in VBA?

    The code below works fabulously except for the DOS window coming up every time the shell command gets executed. I read somewhere, (by which I can't find that site anymore ), that removing the "K" from the shell command below should suppress the DOS box.... but I tried it and the DOS box still keeps coming up LOL!!!

    Here's the my code:

    Sub CopyingExportFileToHeaderFile()
       
    Call Shell("""cmd"" /K copy " & _
        MyPath & " " & "C:\CubeDir\User.h", vbNormalFocus)
    
    End Sub
    Any help is appreciated
    Thanks
    rn

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,364

    Re: Shell command in VBA ?

    Don't know if this will help, not tried it:

    https://support.office.com/en-sg/art...6-6832eadd3c63


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Contributor
    Join Date
    03-07-2013
    Location
    Montreal
    MS-Off Ver
    Excel 2007
    Posts
    274

    Re: Shell command in VBA ?

    it surely help me!!

    Thanks TMS....
    Last edited by RustyNail; 04-26-2015 at 09:34 PM.

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,364

    Re: Shell command in VBA ?

    You're welcome. Thanks for the rep.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. VBA Shell command
    By sumanc_nitr in forum Excel Programming / VBA / Macros
    Replies: 28
    Last Post: 03-06-2014, 07:04 AM
  2. Using macro to execute a command in Shell Command
    By aadarsh in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-19-2010, 07:06 PM
  3. Shell command help
    By ramathiam in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-17-2007, 10:37 PM
  4. shell command
    By jtwork in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-15-2007, 08:07 AM
  5. [SOLVED] Shell command
    By Viktor Ygdorff in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-13-2006, 12:45 PM

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