I am getting this error whenever I attempt to do anything with a file. I have simplified my code to the point where all it does is open the file, then save it (no operations in between), and I always get this error. I'm using version 5.1.2.
Attached are the following files:
error.jpg - screenshot of the message excel throws
primary.xlsx - the file that I'm opening
primary_output.xlsx - the file after I open it and save it using ASPOSE.Net
Here is the code that produces the error
Dim lo As New LoadOptions(LoadFormat.Auto)
Dim wb As New Workbook("d:\code\NationalParks\Output\1\Primary.xlsx", lo)
Response.Clear()
Response.AddHeader("Content-Type", "application/vnd.ms-excel; charset=windows-1251")
Response.AddHeader("content-disposition", "attachment; filename=""" & "test.xlsx" & """")
Dim ms As New IO.MemoryStream
wb.Save(ms, SaveFormat.Xlsx)
Response.BinaryWrite(ms.ToArray())
Response.End()