Hi all,
When I run some code in VBA (which previously ran fine) I am getting a 'label not defined' error.
On the debugger screen it suggests it is the 'GoTo' part, however it looks fine (to me).
Here is the top and bottom part of my code:
TOP:
Private Sub UpdateAll_Click()
Dim LastRow As Long
Dim MaxDate As Date
'Go to error handler on error
1 On Error GoTo ErrorRecord
BOTTOM:
Exit Sub
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'Error Handler
ErrorRecord:
'Select sheet to dump error
732 Workbooks("Update Databases.xls").Sheets("Errors").Range("A1").EntireRow.Insert
'Log errors
733 Workbooks("Update Databases.xls").Sheets("Errors").Range("A1").Value = "Line: " _
& Erl & ", " & "Error " & Err.Number & ": " & Err.Description
'Resume
734 Resume Next
End Sub
-
Any ideas would be appreciated, thanks.
When I run some code in VBA (which previously ran fine) I am getting a 'label not defined' error.
On the debugger screen it suggests it is the 'GoTo' part, however it looks fine (to me).
Here is the top and bottom part of my code:
TOP:
Private Sub UpdateAll_Click()
Dim LastRow As Long
Dim MaxDate As Date
'Go to error handler on error
1 On Error GoTo ErrorRecord
BOTTOM:
Exit Sub
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'Error Handler
ErrorRecord:
'Select sheet to dump error
732 Workbooks("Update Databases.xls").Sheets("Errors").Range("A1").EntireRow.Insert
'Log errors
733 Workbooks("Update Databases.xls").Sheets("Errors").Range("A1").Value = "Line: " _
& Erl & ", " & "Error " & Err.Number & ": " & Err.Description
'Resume
734 Resume Next
End Sub
-
Any ideas would be appreciated, thanks.