Hello All,
Iam using VB 6 Application working in Windows Server 2000 OS.
Iamcreating Excel object by declaring Dim excel_app As Excel.Application and
Set excel_app = CreateObject("Excel.Applic
ation").
Most often if the Program interupts the service created by excel is still running in task manager and when i again start the program it is displayig error. I also tried to kill the process using this code
Set oWMI = GetObject("winmgmts:")
Set oServices = oWMI.InstancesOf("win32_pr
ocess")
For Each oService In oServices
servicename = LCase(Trim(CStr(oService.N
ame) & ""))
If InStr(1, servicename, LCase(processName), vbTextCompare) > 0 Then
ret = oService.Terminate
End If
Next
But when i excute this all excel application are closed, but i want to close the one which i created using vb 6. How to resolve it,
Please someone help me in this issue.
Thanks in advance.
Suresh
Start Free Trial