_Application app;
Workbooks books;
_Workbook book;
Worksheets sheets;
_Worksheet sheet;
Range range;
Font font;
// Start Excel and get Application object.
if(!app.CreateDispatch("Excel.Application"))
{
AfxMessageBox("Couldn't start Excel and get Application object.");
return;
}
//Get a new workbook.
books = app.GetWorkbooks();
book = books.Add (covOptional);
//Get the first sheet.
sheets =book.GetSheets();
sheet = sheets.GetItem(COleVariant((short)1));