ワークシートタブの色を設定

Microsoft Excel でワークシートのタブの色を設定する

  1. 現在のワークシートの下部にあるタブシートでタブを右クリックします。
  2. タブの色を選択します。
  3. パレットから色を選択します。
  4. OK をクリックします。

Aspose.Cellsでワークシートのタブの色を設定する

以下のサンプルコードは、Aspose.Cellsでタブの色を設定する方法を示しています。

// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
// Instantiate a new Workbook
// Open an Excel file
Workbook workbook = new Workbook(dataDir+ "Book1.xlsx");
// Get the first worksheet in the book
Worksheet worksheet = workbook.Worksheets[0];
// Set the tab color
worksheet.TabColor = Color.Red;
// Save the Excel file
workbook.Save(dataDir+ "worksheettabcolor.out.xls");