Get cell style from excel spreadsheet with C#
Im trying to copy some cells from one workbook-sheet to another workbook-sheet and preserve the style and formatting using C#.
I can get the attributes one by one like this:
开发者_JAVA百科string fontName = ((Excel.Range) workSheet.Cells[3, 2]).Font.Name.ToString();
But Im looking for at way to get it all at once. Thanks
If you copy the cell(s) via the clipboard using the Range.Copy Destination:= method then both the content and formatting will be copied. If you just want to copy the formatting use .Copy and then .PasteSpecial formats
精彩评论