title: How to get Excel to ignore apostrophe in beginning of cell
body: <p>I'm writing a tool that syncs a simple database with Excel sheets. Each item in a table in the database corresponds to one row in the worksheet. I read the Excel sheet into the tool using C# and the Excel interop com interface, then compared the items' values (i.e. one of the columns in the excel sheet) after the sync just to make sure that they are equal.</p>
  
  <p>Yesterday I found a case where the comparison wasn't true:</p>
  
  <pre><code>"'&lt;MedalTitle&gt;' Medal - &lt;MedalDescription&gt;"
  "&lt;MedalTitle&gt;' Medal - &lt;MedalDescription&gt;"
  </code></pre>
  
  <p>The second is the one I've read in from Excel, and as you can see it's skipped the first apostrophe. Is there a way to tell Excel to treat the cell as just text (no, just setting the cell's formatting doesn't help)?</p>
  
  <p>I even tried to copy the value ( <strong>'hello'</strong> ) of a cell in VBA like this:</p>
  
  <pre><code>Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
     Target.Offset(1, 0).Value = Target.Worksheet.Range("b2").Value
     Target.Offset(2, 0).Value = Target.Worksheet.Range("b2").Formula
     Target.Offset(3, 0).Formula = Target.Worksheet.Range("b2").Formula
     Target.Offset(4, 0).Formula = Target.Worksheet.Range("b2").Value
  End Sub
  </code></pre>
  
  <p>The result was that the value of target cell is always <strong>hello'</strong></p>
  
  <p>If there is no way, I'll have to do something ugly like </p>
  
  <pre><code>if (dbitem.value[0] == ''' )
  {
     // stuff
  }
  else
  {
     // regular comparison
  }
  </code></pre>