title: Writing a string to a cell in excel
body: <p>I am trying to write a value to the "A1" cell, but am getting the following error: </p>
  
  <blockquote>
    <p>Application-defined or object-defined error '1004'</p>
  </blockquote>
  
  <p>I have tried many solutions on the net, but none are working. I am using excel 2007 and the file extensiton is .xlsm.</p>
  
  <p>My code is as follows:</p>
  
  <pre><code>Sub varchanger()
  On Error GoTo Whoa
  Dim TxtRng  As Range
  
  Worksheets("Game").Activate
  ActiveSheet.Unprotect
  
  Set TxtRng = ActiveWorkbook.Sheets("Game").Cells(1, 1)
  TxtRng.Value = "SubTotal"
  
  'Worksheets("Game").Range("A1") = "Asdf"
  
  LetsContinue:
      Exit Sub
  Whoa:
      MsgBox Err.number
      Resume LetsContinue
  End Sub
  </code></pre>
  
  <p><strong>Edit: After I get error if I click the caution icon and then select show calculation steps its working properly</strong></p>