G
Guest
My understanding is that when you create an Excel object, the correct way to
cause the instance of Excel (in Task Manager Process) is to quit the
application and set the object variable to Nothing.
You will not in my code below that I am doing that. Note that this code is
not attached to a form, yet. The instance of Excel will not go away until I
close my Access database. Could it be where I do the Select? Is it
necesssary to deselect it to get the instance to go away?
Here I open it:
Set xlApp = New Excel.Application
xlApp.DisplayAlerts = False
xlApp.Interactive = False
Set xlBook = xlApp.Workbooks.Open(varGetFileName)
xlBook.Worksheets("Actuals_res_export").Activate
ActiveSheet.Range("F3").Select
Selection.End(xlDown).Select
intLastRow = Selection.Row
code does stuff here
Here I close it:
xlBook.Close
Set xlBook = Nothing
xlApp.Quit
Set xlApp = Nothing
rst.Close
Set rst = Nothing
End Sub
cause the instance of Excel (in Task Manager Process) is to quit the
application and set the object variable to Nothing.
You will not in my code below that I am doing that. Note that this code is
not attached to a form, yet. The instance of Excel will not go away until I
close my Access database. Could it be where I do the Select? Is it
necesssary to deselect it to get the instance to go away?
Here I open it:
Set xlApp = New Excel.Application
xlApp.DisplayAlerts = False
xlApp.Interactive = False
Set xlBook = xlApp.Workbooks.Open(varGetFileName)
xlBook.Worksheets("Actuals_res_export").Activate
ActiveSheet.Range("F3").Select
Selection.End(xlDown).Select
intLastRow = Selection.Row
code does stuff here
Here I close it:
xlBook.Close
Set xlBook = Nothing
xlApp.Quit
Set xlApp = Nothing
rst.Close
Set rst = Nothing
End Sub