Excel workbook closed through vba code still running in the process

pallopammy

New Member
Joined
Aug 5, 2014
Messages
1
Through excel VBA i'm opening the workbook and closing, thus quitting the excel application. But it is still running in the Task manager, which prevents my addin to work properly. part of the code is as follows

Rich (BB code):
Rich (BB code):
Rich (BB code):
   Sheets("Sheet1").Select
  
    Finalrow = Cells(Rows.count, 1).End(xlUp).row


    
LastCol = Cells(1, Columns.count).End(xlToLeft).Column


   
   
   
   '__________________________________________________
   
   
 'Dim oExcel As Excel.Application
   'Dim oBook As Workbook
   'Dim oSheet As Object
  
   
   Set oExcel = New Excel.Application
  


   Set oBook = oExcel.Workbooks.Open(ADDIN_PATH & "\" & "hello.xls")


   Set oSheet = oBook.Worksheets(1)
   


   


   


sCellName = "--Select--"
   
   oSheet.Range("A3").Value = "Name"
   
    If (ComboBox1.Value = "--Select--" Or ComboBox1.Value = "") Then
    MsgBox "Please Map the name field"
    'Else
    'oSheet.Range("B2").Value = ComboBox1.Value
      Exit Sub
   End If
   
   
    'oSheet.Range("B2").Value = ComboBox1.Value
 
   
 
   


   
   
   
   oSheet.Range("B2").Value = ComboBox1.Value
   
      If (ComboBox2.Value = "") Then ComboBox2.Value = sCellName
   


oBook.SaveAs ADDIN_PATH & "\" & "hello.xls"
oBook.Close
oExcel.Quit
Set oExcel = Nothing


   
   
   MsgBox "Your current setting has been saved"
   SettingForm.Hide
End Sub
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest

Forum statistics

Threads
1,223,275
Messages
6,171,127
Members
452,381
Latest member
Nova88

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top