Export to Excel
-
Hello I try to export some data fom my textboxes and comboboxes to a define excel sheet I use this methode but i have an error message when exporting "Dim path As String = CurDir() + "\WebUI\Editors\QuotationReport.xls" Dim ex As Excel.Application Dim wb As Excel.Workbook ' Dim ws As Excel.Worksheet ex = CreateObject("Excel.Application") ex.Visible = False wb = ex.Workbooks.Open(path) Dim objSheet As Excel.Worksheet objSheet = wb.Sheets(1) Dim Somme As Double = 0 "Here i assign the dat to a specific cells" ex = Nothing ex.Workbooks.Close() Response.Clear() Response.AddHeader("Content-Disposition", "attachment; filename=" & file.Name) Response.AddHeader("Content-Length", file.Length.ToString()) Response.ContentType = "application/vnd.ms(-Excel)" Response.WriteFile(file.FullName) please can someone help me. And thanks in advance Assaf
-
Hello I try to export some data fom my textboxes and comboboxes to a define excel sheet I use this methode but i have an error message when exporting "Dim path As String = CurDir() + "\WebUI\Editors\QuotationReport.xls" Dim ex As Excel.Application Dim wb As Excel.Workbook ' Dim ws As Excel.Worksheet ex = CreateObject("Excel.Application") ex.Visible = False wb = ex.Workbooks.Open(path) Dim objSheet As Excel.Worksheet objSheet = wb.Sheets(1) Dim Somme As Double = 0 "Here i assign the dat to a specific cells" ex = Nothing ex.Workbooks.Close() Response.Clear() Response.AddHeader("Content-Disposition", "attachment; filename=" & file.Name) Response.AddHeader("Content-Length", file.Length.ToString()) Response.ContentType = "application/vnd.ms(-Excel)" Response.WriteFile(file.FullName) please can someone help me. And thanks in advance Assaf