Tag: asp.net mvc 5.1

在ASP.NET MVC 5.1中保存Excel文件导致COMException – >它试图将它保存在我的文档中,而不是在项目资源中

我想在服务器端创buildexcel文件,然后将其发送到客户端(启用下载): public ActionResult ExportToExcel() { Microsoft.Office.Interop.Excel.Application xlApp = new Microsoft.Office.Interop.Excel.Application(); xlApp.Visible = true; Workbook wb = xlApp.Workbooks.Add(XlWBATemplate.xlWBATWorksheet); Worksheet ws = (Worksheet)wb.Worksheets[1]; // Select the Excel cells, in the range c1 to c7 in the worksheet. Range aRange = ws.get_Range("C1", "C7"); // Fill the cells in the C1 to C7 range of the worksheet with the […]