Response.AddHeader("content-disposition", "attachment;filename= Salary Slip.xls") Response.ContentType = "application/octectstream" Dim path As String = Server.MapPath("~/exportedfiles") If (Directory.Exists(path) = False) Then Directory.CreateDirectory(path) End If File.Delete(path + "Salary Slip.xlsx") Dim xlAppToExport As Microsoft.Office.Interop.Excel.Application = New Microsoft.Office.Interop.Excel.Application xlAppToExport.Workbooks.Add("") Dim xlWorkSheetToExport As Excel.Worksheet xlWorkSheetToExport = DirectCast(xlAppToExport.Sheets("Sheet1"), Excel.Worksheet)
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)