Posted on: 7/12/2013 8:07:31 AM | Views : 228

hi
i have some code to generate a excel workbook with a sheet filled with some informations.
Instead of just save the excel file locally on the server, i want the user to save in on theres owns computer.
My code to save the file:
Dim fileName As String = Server.MapPath("~/temp/" & Guid.NewGuid().ToString() & ".xlsx") Console.WriteLine(fileName) _excel.ActiveWorkbook.SaveAs(fileName) Response.Clear() Response.ContentType = "application/vnd.ms-excel" Response.AddHeader("content-disposition", "attachment;filename=Konto.xslx") Response.WriteFile(fileName) Response.End() Catch ex As Exception ClientScript.RegisterStartupScript(Me.GetType(), "myalert", "alert('Exporting Failed " & ex.Message & "');", True) ...

Go to the complete details ...