SSRS --> .xlsx file --> SQL ETL -- "External table not in expected format" error, but only when files have not been opened
Here are the possible reasons and solutions I can think of:


The Excel file instance may be getting opened in protected mode. Opening, saving, and closing them is solving this issue temporarily. To fix it permanently, you need to add the Excel file location as a trusted one in the Trust Center.

To do this, you need to go to excel&gt;&gt;file&gt;&gt;options&gt;&gt;Trust center&gt;&gt;trust center settings&gt;&gt;Trusted locations. and add the location of your Excel file there.
Another thing that you can try is changing the file block settings in the same options window for Excel 2007, and later file types according to your needs.
The last reason that I can think of is Excel is unable to identify the type of value being inserted in the columns. This problem is resolved by entering some default sample values in the first row for each column. This workaround helps Excel in deciding what kind of value is getting entered and most of the time fixes the format issue.

For example: 

column1_has_to_get_integer_value then insert any integer value in first row.
column2_has_to_get_string_value then insert any string value in first row.