title: Get Indent of Excel Cell in new column using C#
body: <p>My objective is to add a new column (B) which stores the indent level values (1,2,3..etc) of column A. I do this operation before loading the excel into c# excel object. So my object should have new column B with values of indent for column A.</p>
  
  <pre><code>if (xlWorkbook != null &amp;&amp; xlWorkbook.Sheets.Count &gt; 0)
  {
      Excel._Worksheet xlWorksheet = (Excel._Worksheet)xlWorkbook.Sheets[1];
      Excel.Range oRng = xlWorksheet.Range["B1"];
  
      oRng.EntireColumn.Insert(Excel.XlInsertShiftDirection.xlShiftToRight,
      Excel.XlInsertFormatOrigin.xlFormatFromRightOrBelow);
      oRng = xlWorksheet.Range["B1"];
      oRng.Value2 = "IndentValue";
  
      Excel.Range xlHeaderRange = xlWorksheet.UsedRange;
  
      object[,] excelObj = (object[,])xlHeaderRange.Value2;
  
      string filename = Path.GetFileNameWithoutExtension(sFile);
  
      if (effectiveDate == DateTime.MinValue)
      {
          DateTime.TryParse(Convert.ToString((xlWorksheet.Cells[Definition.DATE_ROW_ID, Definition.DATE_COLUMN_ID] as Excel.Range).Value), out effectiveDate);
      }
  
      xlWorkbook.Close();
  }
  </code></pre>
  
  <p><em>My problem:</em> </p>
  
  <ol>
  <li><p>How to get the indent values in column B?</p></li>
  <li><p>The application pops up for save file as where i expect the workbook
      is saved automatically?</p></li>
  </ol>
  
  <p>Appreciate your help.</p>