Skip to content

Commit

Permalink
Update TestXSSFWorkbook.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
Bykiev committed Jan 3, 2024
1 parent 358e23c commit 8e5a924
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions testcases/ooxml/XSSF/UserModel/TestXSSFWorkbook.cs
Original file line number Diff line number Diff line change
Expand Up @@ -911,14 +911,16 @@ public void TestSetVBAProject()
allBytes[i] = (byte)(i - 128);
}

XSSFWorkbook wb1 = new XSSFWorkbook();
wb1.CreateSheet();
wb1.SetVBAProject(new ByteArrayInputStream(allBytes));
file = TempFile.CreateTempFile("poi-", ".xlsm");
Stream out1 = new FileStream(file.FullName, FileMode.Open, FileAccess.ReadWrite);
wb1.Write(out1);
out1.Close();
wb1.Close();
using(XSSFWorkbook wb1 = new XSSFWorkbook())
{
wb1.CreateSheet();
wb1.SetVBAProject(new ByteArrayInputStream(allBytes));
file = TempFile.CreateTempFile("poi-", ".xlsm");
using(Stream out1 = new FileStream(file.FullName, FileMode.Open, FileAccess.ReadWrite))
{
wb1.Write(out1);
}
}


// Check the package contains what we'd expect it to
Expand Down

0 comments on commit 8e5a924

Please sign in to comment.