• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

close application through excel macro

Sriram Iyengar

New Member
Hi Guys,

Does someone have a VB Code that I can embed in excel & add that excel file to my task scheduler so that when the code is executed it will exit a specific program by clicking on the exit button?
 
Hi,​
maybe possible via Windows API by closing the Windows'name … But why via Excel ?​
Better to search on a Windows script forum …​
 
Hi, Sriram Iyengar!

In addition to Marc L's suggestion, my comments:

a) Task scheduler has tasks, and tasks are calls to executable stuff (programs .exe, libraries .dll, commands .bat/.cmd, scritps .vbs/.js,...), so in the best case you'd schedule an instance of Excel.exe with the required file as 1st argument. This will make Excel run and open the pointed file, which it should have the proper code in the workbook class module for the open event so as to do something automatically.

b) You say:
so that when the code is executed it will exit a specific program by clicking on the exit button?
By "exit" do you mean killing a yet running application, removing a yet scheduled task, or anything else? Please clarify it.

Regards!
 
Back
Top