I’m running this code from Access to format some cells in an exported spreadsheet.
Dim oXL As New Excel.Application
Dim oXB As New Excel.Workbook
oXL.Workbooks.Open (strFILE)
Set oXB = oXL.Workbooks.Open(strFILE)
With oXL.Application
.Columns(“J:J”).Select
.Selection.NumberFormat = “@” ‘formats as text
.Range(“A2”).Select
.Range(Selection, Selection.End(xlDown)).Select
.Selection.NumberFormat = “0” ‘formats as number
.Cells.Select
.Selection.Columns.AutoFit
.Range(“A1”).Select
End With
oXB.Save
Set oXB = Nothing
oXL.Quit
Set oXL = Nothing
If I Ctrl-Alt-Del and go to the task list I still see Excel running in the background.
Am I not closing it properly in the code?
Thanks