G
Guest
Hi all,
I have Access 2002 sp3. In my vba code, I delcared and set an object
variable to Excel. I was able create the instance, have it open a workbook
and do a fews things through code. However, when it was time to close and
save the workbook, and close the instance of Excel and destroy the Excel
object variable, I was unable to. My code looked like:
oExcel.ActiveWorkbook.close
oExcel.Application.Quit 'I tried to use oExcel.Quit, but both do not work.
Set oExcel = Nothing
After the last line, I checked the task manager and I still see the
instance. I then opened another instance of Excel and tried to open the same
file that I had the first instance open. But when I tried, Excel came back
saying the file is being used by me and gave me the option to open it as a
Read Only or Notify.
Does any one know why this is? Thanks for sharing your thoughts.
Ben
--
I have Access 2002 sp3. In my vba code, I delcared and set an object
variable to Excel. I was able create the instance, have it open a workbook
and do a fews things through code. However, when it was time to close and
save the workbook, and close the instance of Excel and destroy the Excel
object variable, I was unable to. My code looked like:
oExcel.ActiveWorkbook.close
oExcel.Application.Quit 'I tried to use oExcel.Quit, but both do not work.
Set oExcel = Nothing
After the last line, I checked the task manager and I still see the
instance. I then opened another instance of Excel and tried to open the same
file that I had the first instance open. But when I tried, Excel came back
saying the file is being used by me and gave me the option to open it as a
Read Only or Notify.
Does any one know why this is? Thanks for sharing your thoughts.
Ben
--