前提・実現したいこと
セルの背景色を取得したい
発生している問題・エラーメッセージ
直前でセルの文字列を取得しているのがあったので使えるかと思って調べていたのですが
分からないので教えてほしいです。
C#
1using System; 2using System.Collections.Generic; 3using System.Data; 4using System.Linq; 5using System.Windows.Forms; 6using System.Windows.Forms.DataVisualization.Charting; 7using System.Globalization; 8using DocumentFormat.OpenXml; 9using DocumentFormat.OpenXml.Packaging; 10using DocumentFormat.OpenXml.Spreadsheet; 11using Microsoft.WindowsAPICodePack.Dialogs; 12using NetOffice.ExcelApi.Enums; 13 14string readAddress; 15Cell theCell = wsPart.Worksheet.Descendants<Cell>().Where(c => c.CellReference == "A2").FirstOrDefault(); 16 17// A列の値を読み込み、存在しないまたは値無しの場合はシート情報の読み取りを終了する 18readAddress = "A" + row.ToString(); 19theCell = wsPart.Worksheet.Descendants<Cell>(). 20 Where(c => c.CellReference == readAddress).FirstOrDefault(); 21 22if (theCell != null) 23{ 24 string value = theCell.InnerText; 25 value = 26 stringTable.SharedStringTable 27 .ElementAt(int.Parse(value)).InnerText; 28 listJp.Add(value); 29 row++; 30} 31else 32{ 33 endFlag = true; 34}
補足情報(FW/ツールのバージョンなど)
DocumentFormat.OpenXml.2.8.1
NetOffice.Core.Net40.1.7.4.4
NetOffice.Excel.Net40.1.7.4.4

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。