I\'m trying to read an Excel (xlsx) file using the code shown below. I get an \"External table is not in the expected format.\" error unless I have the file already open in
I know this is a very old post, but I can give my contribution too, on how I managed to resolve this issue.
I also use "Microsoft.ACE.OLEDB.12.0" as a Provider. When my code tried to read the XLSX file, it received the error "External table is not in the expected format." However, when I kept the file open in Excel and then the code tried to read it ... it worked.
SOLUTION: I use Office 365 with company documents and in my case, the solution was very simple, I just needed to disable the sensitivity of the document, setting it to "public". Detail: Even after saving as "public" the green check still remained marked in "Internal Use", but the problem remained solved after that.