//释放对象
usedRange.ReleaseDispatch();
range.ReleaseDispatch();
sheet.ReleaseDispatch();
sheets.ReleaseDispatch();
//关闭工作薄对象
book.Close(covOptional,COleVariant(strFilePath),covOptional);
books.Close();
//先关闭再释放
book.ReleaseDispatch();
books.ReleaseDispatch();
//退出Excel
excelapp.Quit();
//先退出再释放
excelapp.ReleaseDispatch();
//最后两句不能调换
//如果先释放将调用不到quit()事件