External table is not in the expected format when Excel file is closed
问题 My import works well with an .xls file, but it doesn't work with an .xlsx that I have created in Excel 2010, unless it is opened. My code looks like this: public static DataSet Sheets(string filePath, bool header) { DataSet dsResults = new DataSet(); string hasHeader = header ? "YES" : "NO"; OleDbConnectionStringBuilder sbConnection = new OleDbConnectionStringBuilder(); String strExtendedProperties = String.Empty; sbConnection.DataSource = filePath; if (Path.GetExtension(filePath).ToLower()