I’m not sure if this is an Access problem or an Excel problem or just my problem, but I’ll try posting the question here. I’m using VBA automation code in my Access routines to set up an Excel chart for displaying Access data. For the most part, everything works fine. The problem is that when I close out Excel when I’m done, it doesn’t seem to really get “released” — there’s still an instance of it lurking in Windows XP’s Task Manger (even though it’s left the Task Bar). This seems to cause conflicts (automation errors) when I try to run the code again. If I apply “End Process” to the Excel instance, exit Access, and restart my Access application the routine works again.
The basic framework I use is:
Dim appExcel As Excel.Application
Set appExcel = CreateObject(“Excel.Application”)
appExcel.Visible = True
appExcel.Workbooks.Open
.
.
.
appExcel.ActiveWorkbook.Save
appExcel.Quit
Set appExcel = Nothing
Is there something else I should be doing, housekeeping-wise, to close Excel when I’m done with it? Or is there something else I’m doing wrong?
Thanks,