Consulting

Results 1 to 3 of 3

Thread: how to close an excel file from command line?

  1. #1
    VBAX Regular
    Joined
    Jun 2007
    Posts
    27
    Location

    how to close an excel file from command line?

    I can open an excel using command line
    "excel.exe" /x "c:\temp\book3.xls"
    How can I close book3.xls from commandline?

    Thanks

  2. #2
    VBAX Expert
    Joined
    Aug 2004
    Posts
    810
    Location
    If you are using XP, you can use the TASKKILL command to do the job. You can get a command list by entering TASKKILL /?. As an example:

    TASKKILL /FI "WINDOWTITLE eq Microsoft Excel - Book3.xls"

    Enter the above line as is, that will terminate Excel with Book3.xls loaded. Hope this helps.

    PS - Those quotes, they are part of the command, so make sure you put them in as is - or copy the line.

  3. #3
    VBAX Regular
    Joined
    Jun 2007
    Posts
    27
    Location
    Thanks

Posting Permissions

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