0
我試圖創建一個使用Microsoft.Office.Interop.Excel
一個Excel文件,而這似乎是我的本地機器上使用下面的代碼工作:無法保存到Azure雲服務的文件夾目錄
//Start Excel and get Application object.
oXL = new Microsoft.Office.Interop.Excel.Application();
oXL.Visible = true;
//Get a new workbook.
oWB = (Microsoft.Office.Interop.Excel._Workbook)(oXL.Workbooks.Add(""));
oSheet = (Microsoft.Office.Interop.Excel._Worksheet)oWB.ActiveSheet;
//Add Contact Details for Manager
oSheet.Cells[1, 1] = "Account Manager";
oSheet.Cells[2, 1] = "Manager Name";
oSheet.Cells[3, 1] = "+44(0)2871262626";
oSheet.Cells[4, 1] = "[email protected]";
oSheet.get_Range("A1", "A4").Font.Bold = true;
oXL.DisplayAlerts = false;
oWB.SaveAs(Server.MapPath("~/TransitFiles/") + bill.Landlord.Name + " Group Bill " + bill.LandlordBillID + ".xlsx", Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Microsoft.Office.Interop.Excel.XlSaveAsAccessMode.xlNoChange, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing);
當我嘗試將其部署到我的天藍雲服務我無法生成文件,儘管複製了dll
並創建了相關的文件夾位置,這是由於我放置在那裏的holder.txt文檔,顯示Excel
的最佳方式是什麼文件爲ActionResult
in MVC
?