Results 1 to 7 of 7
  1. #1
    GraeagleBill's Avatar
    GraeagleBill is online now Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    2,097

    Closing a "Shell"ed exe after Shell ends

    I have a 3rd party app (exe) that runs via a Shell command. It is leaving a file open that I need to delete. With that, I get the expected Runtime error 70. Is there a way to from VBA to force the 3rd party app to close?



    This the 3rd party portion of the Shell:
    Code:
    Const Convert As String = "C:\TMSWavMp3Util\ffmpeg\ffmpeg.exe"

  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,556
    Use win management and delete the process?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  3. #3
    GraeagleBill's Avatar
    GraeagleBill is online now Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    2,097
    If you're referring to a manual action via the Task Manager, that's not what I'm looking for. Rather, I'm looking for a VBA statement that will close the ffmpeg.exe application.

  4. #4
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,556
    I am not. I am talking about using vba to kill a process when needed.

    Investigate taskkill also
    https://youtu.be/vBIteVB1Tlc?si=pkgTGtgmwxX73AaC
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  5. #5
    GraeagleBill's Avatar
    GraeagleBill is online now Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    2,097
    Thanks. From your post reference, I garnered this:
    Code:
    Shell ("Taskkill /IM ffmpeg.exe /F, vbHide")
    I either got the statement wrong, or that's not what you'd intended.

    I couldn't find any documentation relating to the "vbHide" switch, so I removed it and the revised statement
    Code:
    Shell ("Taskkill /IM ffmpeg.exe /F)
    "did the trick".

  6. #6
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,556
    Works for me without any issues?
    Code:
    tt="mofffreecalc.exe"
    Call Shell("taskkill /IM " & tt & " /F", vbhide)
    Plus it is unlike Daniel to post anything which does not work?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  7. #7
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,556
    Quote Originally Posted by GraeagleBill View Post
    Thanks. From your post reference, I garnered this:
    Code:
    Shell ("Taskkill /IM ffmpeg.exe /F, vbHide")
    I either got the statement wrong, or that's not what you'd intended.

    I couldn't find any documentation relating to the "vbHide" switch, so I removed it and the revised statement
    Code:
    Shell ("Taskkill /IM ffmpeg.exe /F)
    "did the trick".
    Which does not have a trailing " now I look at it?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 6
    Last Post: 11-10-2021, 10:29 PM
  2. "Shell" de bug
    By JimO in forum Access
    Replies: 2
    Last Post: 07-17-2018, 01:37 AM
  3. Replies: 2
    Last Post: 05-27-2014, 05:54 PM
  4. Replies: 19
    Last Post: 08-07-2010, 05:38 PM
  5. Replies: 2
    Last Post: 02-20-2010, 01:11 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums