「 myFavouriteStyle 」と呼ばれる既存のセル Styleを含む既存の Excel スプレッドシートを編集しています。
OpenXML SDK V2 c# を使用して、そのスタイルのStyleIndexを見つけて、スプレッドシートに追加する新しいセルに適用する方法を教えてください。
ありがとう。
「 myFavouriteStyle 」と呼ばれる既存のセル Styleを含む既存の Excel スプレッドシートを編集しています。
OpenXML SDK V2 c# を使用して、そのスタイルのStyleIndexを見つけて、スプレッドシートに追加する新しいセルに適用する方法を教えてください。
ありがとう。
「myFavouriteStyle」が適用されたセルへの参照を取得できる場合は、次のことができます。
public static int GetCellStyleIndex(Cell theCell)
{
int cellStyleIndex;
if (theCell.StyleIndex == null)
{
cellStyleIndex = 0;
}
else
{
cellStyleIndex = (int)theCell.StyleIndex.Value;
}
return cellStyleIndex;
}