Excel automation: how to disconnect correctly?

  • Thread starter Thread starter Jack
  • Start date Start date
J

Jack

Hello,
My app hooks up to Excel the following way:
Set moExcelApp = CreateObject("Excel.Application")
Set moExcelWS = moExcelApp.ActiveWorkbook.ActiveSheet
and disconnects from it this way:
Set moExcelWS = Nothing
Set moExcelApp = Nothing

When should I use:
moExcelApp.Application.Quit
?
Under what circuimstances?
Is it really necessary to use it?

Your help appreciated,
Jack
 
When should I use:
moExcelApp.Application.Quit

When you want to quit 'your' instance, irrespective as to whether user has
opened their own wb in your moExcelApp or some other reference refers to the
instance. In either case simply 'Set moExcelApp = Nothing' would not close
the app.

I responded to a similar question of yours the other day, not sure if you
saw it.

Regards,
Peter T
 
Back
Top