Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Donate a UDF (UserDefineFunction)
#2
Thanks ssvali for taking the initative.

Here is the first UDF from me.

This will close any running application from taskbar.

Code:
'***************************************************************************************************************************************************************
'Function        :  CloseProcess
'Author         :  Ankesh
'Reviewer       :                                                                                                            
'Version No     :  
'Date Created   :  
'Last Updated   :  
'Desc  :      Forecefully kills a process displayed on the task manager. StrProgramName should contain the process name with extension
'***************************************************************************************************************************************************************
Public Function CloseProcess(strProgramName)
   Dim objShell
    Set objShell = CreateObject("WScript.Shell")
    objShell.Run "TASKKILL /F /IM " & strProgramName
    Set objShell = Nothing
End Fun

'calling the function

Call CloseProcess("EXCEL.EXE") ''Closes excel

Call CloseProcess("Iexplore.EXE") ''Closes IE

'Similar way you can pass any application name running in taskmanager. Function will kill them all.

Regards,[/code]
Ankesh

Reply


Messages In This Thread
Donate a UDF (UserDefineFunction) - by ssvali - 06-08-2012, 05:29 PM
RE: Donate a UDF (UserDefineFunction) - by Ankesh - 06-08-2012, 06:28 PM
RE: Donate a UDF (UserDefineFunction) - by ssvali - 06-20-2012, 04:58 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)