title: CDbl and decimal separators in VB .NET - Is there a way to bypass Regional Settings?
body: <p>I am writing a program that parses and manipulates information (text and numbers) from Excel sheets. I am facing a weird problem regarding converting a cell data to a Double variable. Most of the time, and thanks to the Microsoft.Office.Interop.Excel import, I use:</p>
  
  <pre><code>var = CDbl(sheet.Cells(row,column).Value)
  </code></pre>
  
  <p>However, my sheet (which consists of thousands of rows) contains decimal numbers written with both "." and ",". In my country, "," is considered as decimal separator, so any number like "1.23456789" raises an exception from CDbl.</p>
  
  <p>I have found a workaround, which consists of using not the .Value but the .Text of the cell, and use a Replace() to get rid of the ".":</p>
  
  <pre><code>var = CDbl(sheet.Cells(row,column).Text.Replace(".", ","))
  </code></pre>
  
  <p>However, this increases my execution time greatly, due to the length of the sheets I'm manipulating. What would be the quickest way to do this? Is there any way to tell Visual Studio to get rid of the Regional Settings and consider "." and "," alike? Any other suggestions?</p>
  
  <p>Thank you very much. :)</p>