IWorkbook workbookMerged; using (var file = new FileStream(_importExportHelper.GetFilePath("EXCEL-TEMPLATE-NAME"), FileMode.Open, FileAccess.ReadWrite)) { workbookMerged = new XSSFWorkbook(file); //here } public string GetFilePath(string source, string type = ".xlsx") { string sWebRootFolder = System.IO.Path.GetDirectoryName(Assembly.GetEntryAssembly().Location); var files = new DirectoryInfo(sWebRootFolder + @"\documents\").GetFiles(source + type, SearchOption.TopDirectoryOnly); return files.FirstOrDefault().ToString(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)