I have the following code:
MemoryStream ms = new MemoryStream();
using (var fileStream = File.OpenRead("G:\\tmp\\abc.xls"))
{
fileStream.CopyTo(ms);
}
var reader = ExcelReaderFactory.CreateReader(ms);
Where file abc.xls has the following format:
<div>
<table cellspacing="0" rules="all" border="1" style="border-collapse:collapse;">
<tr>
<th scope="col">Device Name</th><th scope="col">Model Number</th><th scope="col">Software Version</th><th scope="col">ELD Identifier</th><th scope="col">Company Name</th><th scope="col">Phone</th><th scope="col">Email</th><th scope="col">Website</th><th scope="col">Mailing Address</th><th scope="col">City, State, and Zip</th><th scope="col">Data Transfer Options</th>
</tr><tr>
<td>XXX ELD - iOS 2.0</td><td>20I</td><td>Version 3 and higher</td><td>20XX03</td><td>J. J. XX& Associates, Inc.</td><td>XXX-XXX-XXXX</td><td>support@XXXX.com</td><td>www.XXX.com/elogs</td><td>3003 XXXLane</td><td>Neenah, WI 54957</td><td>Telematic (Web Service, Email)</td>
</tr><tr>
......
</tr>
</table>
But I got an error:
ExcelDataReader.Exceptions.HeaderException: Invalid file signature. [2023-04-10T02:43:50.481Z] at ExcelDataReader.ExcelReaderFactory.CreateReader(Stream fileStream, ExcelReaderConfiguration configuration)
What is wrong in my case and how to fix?