I can't get it work using VB.NET

May 6, 2013 at 10:48 PM
The following code is not working:

Try

Dim workbook = New HSSFWorkbook()
Dim sheet As HSSFSheet = workbook.CreateSheet("Sheet1")
Dim row As HSSFRow = sheet.CreateRow(0)
row.CreateCell(0).SetCellValue("Cell1")
            Using ms As New MemoryStream()
                workbook.Write(ms)

                Dim saveAsFileName As String = String.Format("Export-{0:d}.xls", DateTime.Now).Replace("/", "-")


                Response.ContentType = "application/vnd.ms-excel"
                Response.AddHeader("Content-Disposition", String.Format("attachment;filename={0}", saveAsFileName))
                Response.Clear()
                Response.BinaryWrite(ms.GetBuffer())
                Response.End()

            End Using
Catch ex As Exception

End Try

I am getting "ex = {Unable to evaluate expression.}"

Please help
May 7, 2013 at 2:57 PM
solved