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