A thousand thanks, tonyqus. That worked like a charm.
For anyone else having the problem, here's how I fixed it:
//Check for existing workbook
FileStream fs = new FileStream(myExistingWorkbook.xlsx, FileMode.Open, FileAccess.ReadWrite);
IWorkBook workbook = new XSSFWorkbook(fs);
ISheet sheet1 = workbook.CreateSheet(newSheet);
//Code to populate new sheet content goes here
FileStream fs2 = new FileStream(mydocpath + @"\Productivity Report - " + fetch.ToString("MM-dd-yyyy") + ".xlsx", FileMode.Open, FileAccess.ReadWrite);
workbook.Write(fs2);
fs.Close();
For anyone else having the problem, here's how I fixed it:
//Check for existing workbook
FileStream fs = new FileStream(myExistingWorkbook.xlsx, FileMode.Open, FileAccess.ReadWrite);
IWorkBook workbook = new XSSFWorkbook(fs);
ISheet sheet1 = workbook.CreateSheet(newSheet);
//Code to populate new sheet content goes here
FileStream fs2 = new FileStream(mydocpath + @"\Productivity Report - " + fetch.ToString("MM-dd-yyyy") + ".xlsx", FileMode.Open, FileAccess.ReadWrite);
workbook.Write(fs2);
fs.Close();