Through excel VBA I'm opening a workbook and closing it, thus quitting the Excel application. But it is still running in the Task manager, which prevents my addin from working properly. Part of the code is as follows:
Private Sub btn_Click()
Dim oExcel As Object
Dim oBook As Object
Dim oSheet As Object
Dim i As Integer
Dim j As Integer
Sheets("Sheet1").Select
Finalrow = Cells(Rows.count, 1).End(xlUp).row
LastCol = Cells(1, Columns.count).End(xlToLeft).Column
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