The problem is neither in the code you have provided nor in the usage of MVC; the problem looks to be in the content and how it is generated.
If you are just reading a file from a directory and sending it out as a stream; you will need to verify that the file is a valid XLS file with the XLS extension. If it is an XLSX file, you will need to alter your header tags respectively.
If you are programmatically creating this Excel document from data (aka Export), you need to validate that you are both creating a true Excel document AND that the type of Excel document matches the headers.
Here are a few ways this can be accomplished:
6 Easy Ways to Export Data to Excel in C# | Syncfusion Blogs[
^]
Finally, if you are having problems creating a true Excel document; you may want to just fall back onto sending the data out as delineated (plain) text file- such as CSV. This does not require a program (such as Excel) to open it, but Excel is a default opener for it