Problem: Error when trying to query the excel file
"The Microsoft Jet database engine cannot open the file.
It is already opened exclusively by another user, or you need permission to
view its data."

We are developing a .NET component which automates the Excel to generate
some data and exports that data into SQL Server. Here are the steps for the
process:
1. Opens the pre formatted Excel file with required formulas in it.
2. Inserts the data into that spreadsheet.
3. Add/Remove some formulas depending on the conditions.
4. Save the file with different name and close the file.
5. Query the saved file to insert the data in to SQL using OleDb.

This process generates at least 12 files in a minute.

The problem is when we try to query the file. During this process we are
getting the below error:
"The Microsoft Jet database engine cannot open the file.
It is already opened exclusively by another user, or you need permission to
view its data."

I guess this problem may be occurring because the method that it created
this file is still holding this file. I tried to cleanup several ways by
using ReleaseComObject and GC etc. But it works well for first 3 or 4 files
again starts throwing the same error.