Reading Excel Named Ranges by OLEDB hangs when the source file is open

Posted by Sathish on Stack Overflow See other posts from Stack Overflow or by Sathish
Published on 2010-05-06T03:23:17Z Indexed on 2010/05/06 3:28 UTC
Read the original article Hit count: 220

Filed under:

I am trying to read the Excel Named range using OLEDB using the below code

"Select * from [MyNamedRange1]"

everything works fine only when the source excel sheet is not opened if it is open then i am not able to read the range names using OLEDB it simply hangs

Where as i am able to execute the query

"Select * from [Sheet1$]"

even if the workbook is open or closed... Any work arounds for reading the range by OLEDB only i dont want to go for interop... I have too many ranges defined in the excel file

© Stack Overflow or respective owner

Related posts about c#