title: Powershell Excel Cells Not Colored As Expected
body: <p>I am dynamically adding text to an Excel spreadsheet at the end of the rows by specifying</p>
  
  <pre><code>$excel = New-Object -Com Excel.Application
  $excel.Visible = $True
  $wb = $Excel.Workbooks.Add()
  $ws = $wb.Worksheets.Add()
  $lastRow = $ws.UsedRange.rows.count + 1
  </code></pre>
  
  <p>I can add data, but now I'd like to format the two header columns </p>
  
  <p><img src="https://i.stack.imgur.com/XVQsP.jpg" alt="enter image description here"></p>
  
  <p>This is my code </p>
  
  <pre><code>$ws.Range("A$lastRow:B$lastRow").interior.colorindex = 11
  $ws.Range("A$lastRow:B$lastRow").Font.colorindex = 6
  </code></pre>
  
  <p>This is the output</p>
  
  <p><img src="https://i.stack.imgur.com/5q16s.jpg" alt="enter image description here"></p>
  
  <p>How to format the cell with "Number of Computers"?</p>