title: How to write an Excel worksheet to a MemoryStream?
body: <p>I have this code, but it saves to the file</p>
  
  <pre><code>            Excel.Application app = new Excel.Application();
              app.Workbooks.Add();
              Excel._Worksheet sheet = app.ActiveSheet;
              sheet.Cells[1, "A"] = "login";
              sheet.Cells[1, "B"] = "e-mail";
  
              int row = 1;
              foreach (ProviderUser u in users)
              {
                  row++;
                  sheet.Cells[row, "A"] = u.UserName;
                  sheet.Cells[row, "A"] = u.Email;
              }
  
              string pathToSave = Path.Combine(Environment.CurrentDirectory, "users.xlsx");
              sheet.SaveAs(pathToSave);
              app.Quit();
  </code></pre>