I have several excel templates in which I fill the data in run time and move particular tabs from them to a new and single workbook. I am trying to make sure tab color of all the tabs in the final book should be one. But somehow it’s ending up as different color for few tabs in the final workbook.
Here is the code i have. Please advise. Thanks.
// Add a new sheet of type of source Worksheet destSheet = destBook.Worksheets.Add(srcSheet.Name); // Copy the contents of source sheet into newly added destination sheet destSheet.Copy(srcSheet, GetCopyOptionsObject()); // Copy the page setup destSheet.PageSetup.Copy(srcSheet.PageSetup, GetCopyOptionsObject()); destSheet.PageSetup.PrintArea = srcSheet.PageSetup.PrintArea; destSheet.TabColor = srcSheet.TabColor;