Excel instance not shutting down

M

Macca

hi,

I have been using Automation with MFC to write data to an excel spread
sheet. Part of code is shown below :-

// Start Excel and get Application object.

if(!m_objApp.CreateDispatch("Excel.Application"))
{
AfxMessageBox("Couldn't start Excel and get Application object.");
//return;
}

//Get a new workbook.
m_objBooks = m_objApp.GetWorkbooks();
//book = objBooks.Add (COleVariant((short)-4167));
m_objBook = m_objBooks.Add (covOptional);

//Get the first sheet.
m_objSheets = m_objBook.GetSheets();
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top