Sign in to follow this  
Followers 0
joeloyzaga

killexcel

3 posts in this topic

why?

K:\killexcel.vbs.au3(9,14) : WARNING: $KillExcel: possibly used before declaration.

$KillExcel ()

~~~~~~~~~~~~~^

K:\killexcel.vbs.au3(11,1) : ERROR: syntax error (illegal character)

'

^

K:\killexcel.vbs.au3(9,14) : ERROR: $KillExcel: undeclared global variable.

$KillExcel ()

~~~~~~~~~~~~~^

K:\killexcel.vbs.au3 - 2 error(s), 1 warning(s)

!>15:34:31 AU3Check ended.rc:2

+>15:34:38 AutoIt3Wrapper Finished

>Exit code: 0 Time: 7.651

$KillExcel ()

'******************************************************************************

'******************************************************************************

'Used to end any remaining Excel processes

Public Sub $KillExcel ()

'Option explicit

$strComputer = "."

Set $objWMIService = GetObject("winmgmts:\\" & $strComputer & "\root\cimv2")

Set $colProcesses = $objWMIService.ExecQuery ("Select * from Win32_Process Where Name = 'Excel.exe'")

For Each $objProcess in $colProcesses

$objProcess.Terminate()

Next

End Sub

Share this post


Link to post
Share on other sites



Please use AutoIt and Quote tags, I can't read that well enough to help you.


For those who are asking questions, look in the help file first. I'm tired of people asking stupid questions about how to do things when 10 seconds in the help file could solve their problem.[quote name='JRowe' date='24 January 2010 - 05:58 PM' timestamp='1264381100' post='766337'][quote name='beerman' date='24 January 2010 - 03:28 PM' timestamp='1264372082' post='766300']They already have a punishment system for abuse.[/quote]... and his his name is Valik.[/quote]www.minikori.com

Share this post


Link to post
Share on other sites

Try this:

#cs ----------------------------------------------------------------------------

 AutoIt Version: 3.3.0.0
 Author:         myName

 Script Function:
    Template AutoIt script.

#ce ----------------------------------------------------------------------------

; Script Start - Add your code below hereAutoItSetOption ("WinTitleMatchMode", 2 )

while ProcessExists("EXCEL.EXE")
    ProcessClose("EXCEL.EXE")
    ConsoleWrite("closed another instance of EXCEL.EXE" & @CRLF)
    Sleep(1000)
WEnd

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0