title: Excel error -2147319767 (80028029) Suddenly pops up
body: <p>Today suddenly an error popped up in one of our Excel macro sheets that we have been using on a daily basis for three years now. The macro is used to match buy and sell orders based on a forecasted price. On top of this forecasted price we add some uncertainty range to get to the buy_limit and sell_limit variables, which are float numbers. The part of the code that is currently failing, but has worked for three years while nothing changed (not in the code and not in the imported data), is shown below: </p>
  
  <pre><code>For i = 2 To 25
  
      Dim Buy_Limit As Double
      Dim Sell_Limit As Double
  
      Buy_Limit = Sheets("MAIN SHEET").Range("H" &amp; (24 + i)).Value 'Error pops up here
      Sell_Limit = Sheets("MAIN SHEET").Range("I" &amp; (24 + i)).Value 
  </code></pre>
  
  <p>What is happening here? I tried to declare the worksheet before the for loop (as Set mainSheet = ThisWorkbook.Worksheets("MAIN SHEET")) as some suggested in other questions, but this did not help. </p>