I am using EPPlus to generate an XLSX file in C#. As soon as I instantiate the ExcelPackage with a memory stream - I get the error:
\"A disk error occ
I know the question was answered months before, but this is how I do it for future reference to anyone trying:
In VB.NET:
Dim stream As New MemoryStream
Using package As New ExcelPackage(stream)
'Here goes the ExcelPackage code etc
package.Save()
End Using
In C#:
MemoryStream stream = new MemoryStream();
using (ExcelPackage package = new ExcelPackage(stream))
{
//Here goes the ExcelPackage code etc
package.Save()
}
The C# code should be correct, as far as I know. And the ExcelPackage has built-in support for streams.