We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to pass multiple ExcelWorksheetCopyFlags to AddCopy()

Thread ID:





100113 Jul 5,2011 08:58 PM UTC Jul 6,2011 01:51 PM UTC ASP.NET Web Forms (Classic) 1
Tags: XlsIO
Mark Oudesluys
Asked On July 5, 2011 08:58 PM UTC


I was trying to pass multiple ExcelWorksheetCopyFlags to the AddCopy() function. Basically I want to pass the .CopyAll and .CopyPalette flags, as .CopyAll doesn't include the palette.

The command line currently looks like this:
wsPage = destWorkbook.Worksheets.AddCopy(sourceTemplate.Worksheets[0], ExcelWorksheetCopyFlags.CopyAll);

I want to pass something like this:
ExcelWorksheetCopyFlags[] wksFlags = { ExcelWorksheetCopyFlags.CopyAll, ExcelWorksheetCopyFlags.CopyPalette };
wsPage = destWorkbook.Worksheets.AddCopy(sourceTemplate.Worksheets[0], wksFlags);

But it doesn't like this. Any ideas?


Jawahar Jeevanandan J [Syncfusion]
Replied On July 6, 2011 01:51 PM UTC

Hi Mark,

Thank you very much for using syncfusion products.

We don't provide support to copy custom colors set in the workbook through CopyAll flags. The following code snippet will help you to copy the custom colors to destination workbook.

Code Snippet(C#):

dWorkbook.Worksheets.AddCopy(sWorkbook.Worksheets[0], ExcelWorksheetCopyFlags.CopyAll|ExcelWorksheetCopyFlags.CopyPalette);

I have also attached the work around sample with this update. Please try this at your side and let us know if this helps you.

Please let us know if you have any clarifications.




This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon