Advertisement

07.13.2007 at 05:00AM PDT, ID: 22694220
[x]
Attachment Details

Killing a selective Excel Process in vb6

Asked by vijayraj101 in Windows 2000 Server, Visual Basic Programming, Microsoft Excel Spreadsheet Software

Tags: , ,

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.Application").

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_process")
   
      For Each oService In oServices
             
             servicename = LCase(Trim(CStr(oService.Name) & ""))
             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.

SureshStart Free Trial
[+][-]07.13.2007 at 05:05AM PDT, ID: 19479909

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.13.2007 at 05:15AM PDT, ID: 19479992

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.13.2007 at 06:30AM PDT, ID: 19480627

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.13.2007 at 09:14AM PDT, ID: 19482129

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Windows 2000 Server, Visual Basic Programming, Microsoft Excel Spreadsheet Software
Tags: excel, process, vb6
Sign Up Now!
Solution Provided By: charliebiscotti
Participating Experts: 3
Solution Grade: A
 
 
[+][-]07.13.2007 at 12:32PM PDT, ID: 19483736

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.13.2007 at 12:37PM PDT, ID: 19483768

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32