I wrote a code that opens a excel file and reads a specific field. The problem is that every time I execute this code, in the background starts an excel process, the user does not see it, but when you start the Task Manager, you see an excel process. I want to close this background process with VBA. I already tried a lot of different things, but nothing really functions. I already tried:
wb.Close
xcelapp.Application.Quit
Set excelapp = Nothing
Set wb = Nothing
Does any one knows how to close excel with vba?
`Private Sub Command46_Click()
Dim wert As String
Dim sfdcID As String
Dim excelapp As Object
Dim wb As Object
wbName = Combo39.Column(0)
Pfad = "C:\Users\XXXXXX
Details = "Delivery Input"
'Open excel
Set excelapp = CreateObject("excel.application")
Set wb = excelapp.Workbooks.Open(Pfad)
'read SFDC Opportunity ID
Workbooks(wbName).Sheets(Details).Select
Cells.Find(What:="COMPASS WBS ID").Activate
ActiveCell.Offset(1, 0).Select
sfdcID = Selection
MsgBox sfdcID
End Sub`