Using the below code works for 1 Excel Spreadsheet but I need to populate and open 2 Excel and 2 Word documents based on a single button click.
Any ideas?
Protected Sub btnDownload_Click(sender As Object, e As EventArgs) Handles btnDownload.Click 'Get excel sheet Dim xlsVote5 As System.IO.FileInfo = New System.IO.FileInfo(Server.MapPath("~/App_Data/Templates/Vote5-CashflowStatement.xlsx")) Dim PRF As System.IO.FileInfo = New System.IO.FileInfo(Server.MapPath("~/App_Data/Templates/52936.xlsx")) Using pck As New ExcelPackage(xlsVote5) 'Get access to worksheet Dim ws As ExcelWorksheet = pck.Workbook.Worksheets("Cashflow Statement") ws.Cells("C23").Value = "asdfasDF" ws.InsertRow(24, 1, 23) ws.Cells("H24").Formula = "=+F24-G24" 'Write it back to the client Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" Response.AddHeader("content-disposition", "attachment; filename=Vote5-CashflowStatement.xlsx") Response.BinaryWrite(pck.GetAsByteArray()) End Using End Sub