Quantcast
Channel: ClosedXML - The easy way to OpenXML
Viewing all articles
Browse latest Browse all 1877

New Post: Issue while copying worksheets

$
0
0
MDeLeon.. Thanks for the reply..

That workbook doesnt have any worksheets in it.. I am getting the same error even I change it to following code.
public void WriteStaticSheets(XLWorkbook wb)
        {
            var workbookTemplate = new XLWorkbook("D:\\BIP Forecast Template - Guide.xlsx");
           foreach(var ws in workbookTemplate.Worksheets)
            {
                if (!wb.Worksheets.Where(x => x.Name == ws.Name).Any())
                {
                    wb.AddWorksheet(ws);
                }
            }
        }

Viewing all articles
Browse latest Browse all 1877

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>