View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Alexander Pachwald Alexander Pachwald is offline
external usenet poster
 
Posts: 1
Default OleDBConnection.Open() blocks with 100% CPU

Hi!

I create a database connection to an Excel 2007 .xlsx file using the
following connection string:

string cs = "Provider=Microsoft.ACE.OLEDB.12.0;" +
"Data Source=" + filename +
";Extended Properties=\"Excel 12.0;HDR=YES\";";

After instantiating an OleDbConnection, I call connection.Open().

This all works fine for a simple Excel file with three sheets, two of them
empty. A more complex version with eight filled sheets (no calculation on
them!) makes the Connection.Open() command block using 100% CPU. When I
execute the code while the file is opened in Excel 2007, everything works
fine.

Any suggestions?

Thanks for your attention,
Alex