title: How to get the number of columns in the given row in Excel sheet with C#?
body: <p>I am using  C# Interop Excel and I have a Excel sheet with the column names in the first row and some data below it. So I want to get the number of the column names which means the number of columns in the first row.</p>
  
  <p>I have tried something like that but it returns incorrect value:</p>
  
  <pre><code>int colCount = ((Excel.Range)xlWorkSheet.Rows[1]).EntireRow.Columns.Count;
  </code></pre>
  
  <p>Any idea how can I get the first row as a range and then get count of the columns in this range?</p>