Convert XML Spreadsheet to

For many years we have been creating Excel 2003 XML spreadsheets and sending them to our clients though a http.Response stream. Which would open Excell 2010 on their machines, and all was good. We are now being updated to Windows 10 and excel 2016, and Web pages and excell 2003 XML spreadsheets are being blocked. We have hundreds of reports to rewrite with no time available. I was hoping to use Aspose.cells to read the XML spreadsheets from a stream and write a xlsx file to a stream. See the code below. There are no errors, but the only thing in the files is: “Evaluation Only. Created with Aspose.Cells for .Net. Copyright 2003 - 2018 Aspose Pty Ltd” Should my data have been there if I was successful, or am I doing something wrong? Any help is appreciated.

Thanks
Bob

Code:

   Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
        Try
            Dim nominationsDataTable As DataTable = Session(Common.sessionStateAwardNominationsString)
            Dim spreadSheetString As String = Common.BuildNominationsSpreadSheet(nominationsDataTable)
            Dim currentDateString As String = Microsoft.VisualBasic.Format(Now, "yyyy_MM_dd")
            Dim fileNameString As String = "Nominations_" & currentDateString & ".xlsx"

            'Response.Write(spreadSheetString)
            Dim bufferBytes() As Byte = System.Text.Encoding.UTF8.GetBytes(spreadSheetString)
            Dim inMemoryStream As New MemoryStream(bufferBytes)
            Dim outMemoryStream As MemoryStream = New MemoryStream

            'Read Spreadsheet from Stream
            inMemoryStream.Position = 0
            Dim loadOptions As New LoadOptions(LoadFormat.SpreadsheetML)
            Dim workbook As New Workbook(inMemoryStream, loadOptions)

            'Write Spreadsheet to Stream
            Dim xSaveOptions As New XlsSaveOptions(SaveFormat.Xlsx)
            workbook.Save(outMemoryStream, xSaveOptions)
            outMemoryStream.Position = 0

            Response.ContentType = "application/vnd.ms-excel"
            Response.AppendHeader("content-disposition", "attachment; filename=" + fileNameString)
            Response.BinaryWrite(outMemoryStream.ToArray())
            Response.Flush()
            Response.End()
            inMemoryStream.Close()
            outMemoryStream.Close()
        Catch ex As Exception
            Common.WriteToErrorLog(myWeb, "NominationsExcel: " & ex.Message & " - " & ex.StackTrace)
        End Try
    End Sub

.

Never mind, did not notice that the message is on an additional sheet. My data is there on the first sheets.

@Bobsimoneau

Thanks for using Aspose APIs.

Evaluation Only. Created with Aspose.Cells for .Net. …

This message appears when you are not setting the license or you have not purchased the license and you are using Aspose.Cells in Evaluation Mode.

Please note, when you purchase a license, you get a license file. It could be of any name but it ends with .lic extension. If you open it in Notepad, you will see, it is actually an XML file.

After receiving the .lic file, you must set the Aspose.Cells like this before you execute any other Aspose.Cells APIs.

VB. Net

Dim licPath As String = "F:\Download\Aspose.Total.lic"
Dim lic As Aspose.Cells.License = New Aspose.Cells.License
lic.SetLicense(licPath)

For more information relating to licensing, please see this article.