Your code executes on the host system and when deployed to a SharePoint site that host system would need to have Excel installed and security access enabled to run it. That solution would not scale or work well as you would be trying to attempt multithreaded access from a web server thread.
You need to follow a different design pattern like working with OpenXml (on client or server) or interact with the Office365 API's as this is in the cloud.