+ Reply to Thread
Results 1 to 4 of 4

Use Shell command to open another app maximised

Hybrid View

AndyCotgreave Use Shell command to open... 01-19-2012, 12:03 PM
Firefly2012 Re: Use Shell command to open... 01-19-2012, 12:47 PM
AndyCotgreave Re: Use Shell command to open... 01-19-2012, 12:58 PM
snb Re: Use Shell command to open... 01-19-2012, 01:09 PM
  1. #1
    Registered User
    Join Date
    01-19-2012
    Location
    Oxford
    MS-Off Ver
    Excel 2007
    Posts
    2

    Use Shell command to open another app maximised

    HI there,
    First post (I defected from Excel-L!) - hello all.

    I'm opening another application (Tableau) from within Excel, connecting Tableau directly to the current file. I am building the following string to use in the Shell command:
    "C:\Program Files (x86)\Tableau\Tableau 7.0\bin\tableau.exe" "C:\Users\acotgreave\Dropbox\TableauReshaper\test data.xlsx"
    When I run this from the command line, Tableau opens maximized. However, when I run the same code through a VBA Shell command, Tableau opens in a minimised state:
        ' construct the command line and execute it
        strCmdLine = Replace(strTableau, "%1", ActiveWorkbook.FullName)
        Shell (strCmdLine & " /max")
    Any ideas how I can force the other app to be maximised?

    Thanks

  2. #2
    Forum Contributor
    Join Date
    12-28-2011
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    280

    Re: Use Shell command to open another app maximised

    Hi

    Shell strCmdLine, 3

  3. #3
    Registered User
    Join Date
    01-19-2012
    Location
    Oxford
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Use Shell command to open another app maximised


    Gosh, that's embarrassing. I've been writing VBA code for getting on 10 years and didn't know Shell had a second parameter.
    That's sorted the problem out - thanks very much.
    Andy

  4. #4
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Use Shell command to open another app maximised

    or
    Createobject("wscript.shell").run "notepad.exe",3



+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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