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

New Post: Issue while copying worksheets

$
0
0
Your code does the following.
1) find a worksheet in the workbook
2) add that worksheet into the same workbook without changing the name

The result is that it finds that a worksheet already exists in the workbook with that name.
You need to give it a new name when you make the copy.
You would need to do "ws.CopyTo(wb,"NewName");
or "ws.CopyTo("NewName");

Check out the documentation https://closedxml.codeplex.com/wikipage?title=Copying%20Worksheets

Viewing all articles
Browse latest Browse all 1877

Trending Articles



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