0
我想輸出一個使用EPPLUS創建的ExcelPackage到一個沒有Excel的文件路徑實際打開文件。我現在有下面的代碼...我做錯了什麼?謝謝。如何在不打開Excel的情況下將ExcelPackage保存到本地路徑?
Dim FileName As String = "C:\Temp\" + CurrAcct + ".xlsx"
Dim Result As New MemoryStream()
xlPackage.SaveAs(Result)
Context.Response.Clear()
Context.Response.ContentType = "application/vnd.openxmlformats- officedocument.spreadsheetml.sheet"
Context.Response.AddHeader("Content-Disposition", "attachment;filename=" + FileName + ".xlsx")
Result.WriteTo(Context.Response.OutputStream)
Context.Response.End()
明白了,謝謝! – StephenT
沒問題!祝你好運! – SMASH