开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜