title: FormatConditions.Add(Type:=xlTextString, TextOperator:=xlContains, String:="myText")
body: <p>I have a VBA code, which I want to convert into my python script. </p>
  
  <pre><code>Sub formatStatus()
  
  Dim ws As Worksheet
  Dim fc_blocked As FormatCondition
  
  Set ws = ThisWorkbook.ActiveSheet()
  
  ws.Columns(1).FormatConditions.Delete
  
  Set fc_blocked = ws.Columns(1).FormatConditions.Add(Type:=xlTextString, TextOperator:=xlContains, String:="blocked")
  fc_blocked.Font.Color = RGB(100, 48, 160)
  fc_blocked.Interior.Color = RGB(180, 120, 250)
  
  End Sub
  </code></pre>
  
  <p>My python code looks like this:</p>
  
  <pre><code>import win32com.client as win32
  
  fcBlocked = ws.Columns(iCol).FormatConditions.Add(Type = win32.constants.xlTextString, TextOperator=win32.constants.xlContains, String='blocked')
  fcBlocked.Font.Color = int('%02x%02x%02x' % (100, 48, 160)[::-1],16)
  fcBlocked.Interior.Color = int('%02x%02x%02x' % (180, 120, 250)[::-1],16)
  </code></pre>
  
  <p>But I get an exception. </p>
  
  <p>I successfully tried</p>
  
  <pre><code>fcBlocked = ws.Columns(iCol).FormatConditions.Add(Type = win32.constants.xlCellValue, TextOperator=win32.constants.xlEqual Formula1='="blocked"')
  fcBlocked.Font.Color = int('%02x%02x%02x' % (100, 48, 160)[::-1],16)
  fcBlocked.Interior.Color = int('%02x%02x%02x' % (180, 120, 250)[::-1],16)
  </code></pre>
  
  <p>but this checks if the text is equal, and not if the string contains 'blocked'. </p>
  
  <p>Can someone give me an advice? </p>
  
  <p>Thanks in advance and best regards!</p>