// Create a new workbook Workbook workbook = new Workbook(); InputStream existingFile = getResourceStream("xlsx/FinancialReport.xlsx"); workbook.open(existingFile); IRange cells = workbook.getActiveSheet().getCells(); // Find all formulas IRange allFormulas = cells.specialCells(SpecialCellType.Formulas); // Find all constants IRange allConstants = cells.specialCells(SpecialCellType.Constants); // Change background color of found cells allFormulas.getInterior().setColor(Color.GetLightGray()); allConstants.getInterior().setColor(Color.GetDarkGray()); // Save to an excel file workbook.save("SpecialCellsInExistingFiles.xlsx");