title: Fast way to get Excel range as array of texts or cell formats in C#?
body: <p>Array operations are way faster than range operations in VSTO, so currently I'm using </p>
  
  <pre><code>object[,] RangeValues = wsh.get_Range("A1:" + lastCell.Address).Value2;
  </code></pre>
  
  <p>with pretty good effect. Sadly, I have some inconsistent data. Sometimes there is <code>0.45</code>, and sometimes <code>0.45%</code>, and of course later i see it as <code>0.0045</code> in code. Sadly, from "business" point of view, both values means <code>0.45</code>. I cannot force consistency, files come from various sources I don't have any authority over. It's something I need to deal with.</p>
  
  <p>The way, of course, would be to look at format, or at display text, and see if there is a <code>%</code> sign in it. If there is, I just need to multiply value by 100. Sadly, if I try:</p>
  
  <pre><code>object[,] RangeValues = wsh.get_Range("A1:" + lastCell.Address).Text;
  </code></pre>
  
  <p>I get message that cannot convert <code>DBNull</code> to <code>object[,]</code>. So is there any way that would allow me to load texts or formats all at once, without going thorough code &lt;-> worksheet border at each step of mu loop?</p>