Do you know what the OLE error is?



Sytze de Boer wrote:
> Foxers, does anyone have time to check/help me with this ?
>
> My routine goes as follows
> and I'm slowly losing my mind as to why so many clients are phoning me to
> say that even though Excel is closed, it is
> 1  Still asking if ok to close it
> 2  OR getting an OLE something error
>
> (trcask6 is a mem variable and if it returns "OPEN", it aborts the routine)
>
> Is the loProcess.TERMINATE() version dependent ?
>
> My system will run
> DO KILLTHATAPP with 1 of the below params
>
> PARAMETERS whatapp
> DO case
> CASE whatapp="IEXPLORE"
>    lcProcess = "IEXPLORE.EXE"  && Process to be closed
> CASE whatapp="NOTEPAD"
>    lcProcess = "NOTEPAD.EXE"  && Process to be closed
> CASE whatapp="EXCEL"
>    lcProcess = "EXCEL.EXE"  && Process to be closed
> ENDCASE
>
> lcComputer = "."
> loWMIService = GETOBJECT("winmgmts:" + "{impersonationLevel=impersonate}!\\"
> + lcComputer + "\root\cimv2")
> colProcessList = loWMIService.ExecQuery ("Select * from Win32_Process")
>
> IF TYPE('colProcessList') = "O"
>   FOR EACH loProcess IN colProcessList
>      IF ALLTRIM(UPPER(loProcess.NAME)) == ALLTRIM(UPPER(lcProcess))
>         rt=MESSAGEBOX(""+whatapp+" is open at the moment. Is it ok to close
> it ? ",4+32+256,'')
>         IF rt=6
>            loProcess.TERMINATE()
>         ELSE
>            trcask6="OPEN"
>         endif
>       ENDIF
>   NEXT
> ENDIF  && IF TYPE('colProcessList') = "O"
>
> RELEASE colProcessList, loWMIService
>
>
>   



_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to