views:

246

answers:

1

How can I mannually terminate an excel application using OLE Automation?

I would like to do this in some exception handling so that an excel process does not remain running if a function throws an error.

Currently I use the below code to open excel:

Variant excel = Variant::CreateObject("Excel.Application");

+2  A: 

Like this:

OleVariant excel;

excel = Variant::CreateObject("Excel.Application");
//
// Your code
//
excel.OleProcedure("Quit");
DR