title: Need solution to: "Sorry an error occurred object doesn't support this property or method"
body: <p>I have code that uses information from a set of text boxes in a userform to find and edit values in two workbooks. The code that I am using to edit the values in the second workbook gives me the following error, "Sorry an Error Occurred Object doesn't support this property or method". Can anyone help me with this? Aside from what is causing the error I think my code is correct but if anyone sees any errors in my code by all means please feel free to correct me or offer suggestions. Thanks in advance! </p>
  
  <pre><code>Private Sub Submit_Click()
  Dim WS As Worksheet
  Dim lastrow As Long
  Dim r As Long
  Dim password As String
  
  Application.ScreenUpdating = False
  If Not IsNumeric(TextBox1.Text) Then
  On Error GoTo ErrorHandler
  password = TextBox1.Text
  Set WS = ActiveWorkbook.Worksheets("Accounts")
  lastrow = WS.Cells(Rows.Count, "A").End(xlUp).Row
  For r = 2 To lastrow
  If WS.Cells(r, 2) = Label5.Caption Then
  WS.Cells(r, 2).Value = TextBox1.Text
  WS.Cells(r, 3).Value = TextBox2.Text
  WS.Cells(r, 4).Value = TextBox3.Text
  MsgBox "Update Successful", vbInformation
  TextBox1.Text = ""
  Call Edit_Login
  Application.ScreenUpdating = True
  Exit Sub
  End If
  Next
  MsgBox "Data not Found!!", vbCritical
  TextBox1.Text = ""
  Unload Me
  Application.ScreenUpdating = True
  Exit Sub
  ErrorHandler: MsgBox "Sorry an Error occured. " &amp; vbCrLf &amp; Err.Description
  Exit Sub
  End If
  MsgBox "Please Enter Correct Information", vbCritical
  Application.ScreenUpdating = True
  End Sub
  
  Private Sub Edit_Login()
  Dim Wkbk As Workbook
  Dim txt As String
  Dim txt2 As String
  Dim txt3 As String
  Dim lastrow As Long
  Dim r As Long
  Dim Account As String
  
  Application.ScreenUpdating = False
  Application.EnableEvents = False
  Application.DisplayAlerts = False
  If Not IsNumeric(TextBox1.Text) Then
  On Error GoTo ErrorHandler
  Account = TextBox1.Text
  Set Wkbk = Workbooks.Open("C:\Users\kameron\Desktop\Quality Improvement 
  Software\Log In.xlsm")
  lastrow = Wkbk.Cells(Rows.Count, "A").End(xlUp).Row
  For r = 2 To lastrow
  If Wkbk.Sheets("Tables").Cells(r, 1) = Label5.Caption Then
  Wkbk.Sheets("Tables").Cells(r, 1).Value = TextBox1.Text
  Wkbk.Sheets("Tables").Cells(r, 2).Value = TextBox2.Text
  Wkbk.Sheets("Tables").Cells(r, 3).Value = TextBox3.Text
  MsgBox "Update Successful", vbInformation
  TextBox1.Text = ""
  TextBox2.Text = ""
  TextBox3.Text = ""
  Unload EditAccount
  Application.ScreenUpdating = True
  Exit Sub
  End If
  Next
  MsgBox "Data not Found!!", vbCritical
  TextBox1.Text = ""
  Unload Me
  Application.ScreenUpdating = True
  Exit Sub
  ErrorHandler: MsgBox "Sorry an Error occured. " &amp; vbCrLf &amp; Err.Description
  Exit Sub
  End If
  MsgBox "Please Enter Correct Information", vbCritical
  Application.ScreenUpdating = True
  Application.EnableEvents = True
  Application.DisplayAlerts = True
  End Sub
  </code></pre>