Q:

Pass SharePoint Credentials to Access Excel File using Interop?

string url = HttpUtility.HtmlAttributeEncode("https://site.sharepoint.com/sites/Project/Shared%20Documents/ExcelSheet.xlsx");

        Excel.Application xlApp = new Excel.Application();
        Excel.Workbook xlWorkbook = xlApp.Workbooks.Open(url):

This prompts me for an email(userid) and password, I know I can pass the password but how do I get the email(userid) in there.
I also have the SharpePoint credentials saved, I intially tried using the SharepointClient but I got as far as being able download the File, I couldn't figure out how to convert it to an Excel workbook to loop through the cells.
ClientContext context = new ClientContext("https://site.sharepoint.com/sites/Project/"):          
SecureString passWord = new SecureString();

 context.Credentials = new SharePointOnlineCredentials(password)      

Cheers!

A:

Instead of Excel Interop i would propose to utilize Excel Services REST API which allows to read excel data without any dependencies to external or third party libraries.
Example
The following example demonstrates how to read workbook data from Financial Sample.xlsx sample excel file stored in SharePoint Online Documents library 
var credentials = GetCredentials(userName, password);
var client = new ExcelClient(webUrl, credentials);
var data = client.ReadTable("Shared Documents/Financial Sample.xlsx", "Sheet1","A1", "P500");
JObject table = JObject.Parse(data);
int idx = 0;
foreach(var row in table["rows"])
{
     if(idx == 0)
     {
        //skip header
     }
     else
     {
        //get cell values
        var segment = row[0]["v"] as JValue;
        var country = row[1]["v"] as JValue;
        Console.WriteLine("Segment: {0}, Country: {1}", segment.Value,country.Value);
     }
     idx++;
}

where
WebClient class is utilized to consume Excel Services REST
public class ExcelClient : WebClient
{

    public ExcelClient(string webUrl, ICredentials credentials)
    {
        BaseAddress = webUrl;
        Credentials = credentials;
        Headers.Add("X-FORMS_BASED_AUTH_ACCEPTED", "f");
    }

    public string ReadTable(string fileUrl, string sheetName, string cellStart,string cellEnd, string format="json")
    {

        var endpointUrl = BaseAddress + string.Format("/_vti_bin/ExcelRest.aspx/{0}/Model/Ranges('{1}!{2}|{3}')?$format={4}", fileUrl,sheetName,cellStart,cellEnd,format);
        return DownloadString(endpointUrl);
    }

}

and SharePointOnlineCredentials class to access SharePoint Online resources via user credentials 
static ICredentials GetCredentials(string userName, string password)
{
    var securePassword = new SecureString();
    foreach (var c in password)
    {
        securePassword.AppendChar(c);
    }
    return new SharePointOnlineCredentials(userName, securePassword);
}

Results

References

Sample URI For Excel Services REST API
Requesting Excel workbook data from SharePoint Server using OData

