I'm trying to create a proof of concept page using the Aspose Cells API.
The function of the page is to have the user upload an Excel file from their computer, and then have the API take the data from the one worksheet in that file and load it into a DataTable, then to a DataGrid.
I have the code in place to do this, but I keep getting an error saying that part of the path cannot be found. Here is the code that I have:
'Get file name and assign it to the variable
Dim pathName As String
pathName = System.IO.Path.GetFileName(Me.FileUploadReport.PostedFile.FileName)
'pathName = Me.FileUploadReport.PostedFile.FileName.ToString
'Instantiate a new workbook
Dim workbook As New Workbook(pathName)
'Get the first worksheet in the workbook
Dim worksheet As Worksheet = workbook.Worksheets(0)
'Create a datatable
Dim datatable1 As New DataTable()
'Export worksheet data to a datatable object by calling either ExportDataTable or ExportDataTableAsString
'method of the Cells class
datatable1 = worksheet.Cells.ExportDataTable(0, 0, worksheet.Cells.MaxRow + 1, worksheet.Cells.MaxColumn + 1)
'Bind the DataGrid with DataTable
DataGrid1.DataSource = datatable1
DataGrid1.ShowHeader = True
Do you have any ideas why it isn't able to find the path?