can you check this vba code for the email tracker in excel that im tring to do 

' --- Main Setup for a New Excel File ---
Sub InitializeFullEmailTracker()
    ' Create the main sheet if not present
    Dim ws As Worksheet, wsLog As Worksheet
    On Error Resume Next
    Set ws = ThisWorkbook.Sheets("Sheet1")
    If ws Is Nothing Then
        Set ws = ThisWorkbook.Sheets.Add
        ws.Name = "Sheet1"
    End If
    On Error GoTo 0
    
    ' Create Activity Log sheet
    On Error Resume Next
    Set wsLog = ThisWorkbook.Sheets("ActivityLog")
    If wsLog Is Nothing Then
        Set wsLog = ThisWorkbook.Sheets.Add
        wsLog.Name = "ActivityLog"
    End If
    On Error GoTo 0

    ' --- Setup Headers in the tracker ---
    ws.Cells(1, 1).Value = "Email Subject"
    ws.Cells(1, 2).Value = "Recipients"
    ws.Cells(1, 3).Value = "Status"
    ws.Cells(1, 4).Value = "Remarks"
    ws.Cells(1, 6).Value = "Delete" ' Moved the Delete column to the right (column 6)
    
    ' --- Setup Input Fields ---
    ws.Cells(2, 1).Value = "Input Subject Here"
    ws.Cells(2, 2).Value = "Input Recipients Here"
    
    ' --- Setup Button for adding to the list ---
    Dim btn As Button
    Set btn = ws.Buttons.Add(450, 10, 100, 20) ' Adjusted position to avoid overlap
    btn.Caption = "Add to List"
    btn.OnAction = "AddEmailToList"
    
    ' --- Activity Log Setup ---
    wsLog.Cells(1, 1).Value = "Date"
    wsLog.Cells(1, 2).Value = "Action"
    
    MsgBox "Email Tracker Initialized. You're ready to go!"
End Sub

' --- Adds email details to the tracker and sets up a hyperlink to Outlook ---
Sub AddEmailToList()
    Dim ws As Worksheet
    Set ws = ThisWorkbook.Sheets("Sheet1")
    
    Dim subject As String, recipients As String
    subject = ws.Cells(2, 1).Value
    recipients = ws.Cells(2, 2).Value
    
    If subject = "" Or recipients = "" Then
        MsgBox "Please enter both subject and recipients!"
        Exit Sub
    End If
    
    ' Find the next available row
    Dim nextRow As Long
    nextRow = ws.Cells(ws.Rows.Count, 1).End(xlUp).Row + 3 ' Leave space below input fields
    
    ' Add the subject as a hyperlink
    ws.Hyperlinks.Add Anchor:=ws.Cells(nextRow, 1), Address:="", _
                      SubAddress:="'Sheet1'!A" & nextRow, _
                      TextToDisplay:=subject, _
                      ScreenTip:="Click to search conversation in Outlook"
                      
    ' Store the subject in the cell's comment for future reference
    ws.Cells(nextRow, 1).AddComment subject
    ws.Cells(nextRow, 1).Comment.Visible = False
    
    ' Extract email addresses from the recipients field
    Dim emailList As String
    emailList = ExtractEmails(recipients)
    ws.Cells(nextRow, 2).Value = emailList
    
    ' Set status and remarks
    ws.Cells(nextRow, 3).Value = "Followed Up"
    ws.Cells(nextRow, 4).Value = "Awaiting Response"
    
    ' Add Delete Button
    ws.Buttons.Add 550, ws.Cells(nextRow, 5).Top, 100, 20 ' Reposition delete button to avoid overlap
    With ws.Buttons(ws.Buttons.Count)
        .Caption = "Delete"
        .OnAction = "DeleteRow"
        .Tag = nextRow ' Store row number in the button's Tag property
    End With
    
    ' Log Activity
    LogAction "Added email: " & subject
    
    ' Refresh email response checking
    CheckEmailResponses
End Sub

' --- Search Outlook Conversations for the Email Subject ---
Sub HyperlinkClicked()
    Dim ws As Worksheet
    Set ws = ThisWorkbook.Sheets("Sheet1")
    
    Dim subject As String
    subject = ActiveCell.Comment.Text ' Retrieve the subject from the cell comment
    
    If subject = "" Then
        MsgBox "No subject found!"
        Exit Sub
    End If
    
    ' Call the function to search Outlook for the subject
    Call SearchOutlookConversations(subject)
End Sub

' --- Searches Outlook for conversations matching the email subject ---
Sub SearchOutlookConversations(subject As String)
    Dim olApp As Object
    Dim olExplorer As Object
    Dim searchText As String
    Dim olSearchScopeAllFolders As Integer

    ' Corresponds to olSearchScopeAllFolders
    olSearchScopeAllFolders = 2

    ' Format the subject for conversation search
    searchText = "[Conversation]:=""" & subject & """"

    ' Initialize Outlook application
    On Error Resume Next
    Set olApp = GetObject(, "Outlook.Application")
    If olApp Is Nothing Then
        Set olApp = CreateObject("Outlook.Application")
    End If
    On Error GoTo 0

    ' Access the active explorer and perform the search
    Set olExplorer = olApp.Explorers.Add(olApp.Session.GetDefaultFolder(6), olFolderDisplayNormal)
    olExplorer.Activate
    DoEvents ' Ensures that the explorer window is fully loaded

    If Not olExplorer Is Nothing Then
        olExplorer.Search searchText, olSearchScopeAllFolders
        olExplorer.Activate
    Else
        MsgBox "Please ensure Outlook is properly set up.", vbExclamation
    End If
End Sub

' --- Extracts email addresses from a string containing names and emails ---
Function ExtractEmails(ByVal recipientStr As String) As String
    Dim regex As Object
    Set regex = CreateObject("VBScript.RegExp")
    regex.Pattern = "\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,7}\b"
    regex.Global = True
    
    Dim matches As Object
    Set matches = regex.Execute(recipientStr)
    
    Dim emailList As String
    Dim match As Object
    For Each match In matches
        emailList = emailList & match.Value & "; "
    Next match
    
    ExtractEmails = Left(emailList, Len(emailList) - 2) ' Remove trailing ";"
End Function

' --- Deletes the row for the email in the tracker and the associated delete button ---
Sub deleteRow()
    Dim ws As Worksheet
    Set ws = ThisWorkbook.Sheets("Sheet1")
    
    ' Get the row to delete from the button's tag
    Dim deleteRow As Long
    deleteRow = Application.Caller
    
    ' Delete the row
    ws.Rows(deleteRow).Delete
    
    ' Delete the corresponding button
    Dim btn As Button
    For Each btn In ws.Buttons
        If btn.TopLeftCell.Row = deleteRow Then
            btn.Delete
            Exit For
        End If
    Next btn
    
    ' Log Action
    LogAction "Deleted email entry from row " & deleteRow
End Sub

' --- Logs actions in the Activity Log sheet ---
Sub LogAction(ByVal action As String)
    Dim wsLog As Worksheet
    Set wsLog = ThisWorkbook.Sheets("ActivityLog")
    
    Dim nextLogRow As Long
    nextLogRow = wsLog.Cells(wsLog.Rows.Count, 1).End(xlUp).Row + 1
    
    wsLog.Cells(nextLogRow, 1).Value = Now ' Log timestamp
    wsLog.Cells(nextLogRow, 2).Value = action ' Log the action description
End Sub

' --- Regularly save a backup of the workbook ---
Sub AutoBackup()
    Dim backupPath As String
    backupPath = ThisWorkbook.Path & "\Backup_" & Format(Now, "yyyy_mm_dd_hh_mm_ss") & ".xlsm"
    
    ThisWorkbook.SaveCopyAs backupPath
    LogAction "Backup saved to: " & backupPath
End Sub

' --- Scheduled Task for Follow-up & Escalation ---
Sub FollowUpEscalation()
    ' Follow-up logic that checks if responses are received after 10 days,
    ' sends automated follow-ups, and handles escalation.
End Sub

' --- Automatically Set Up on Workbook Open ---
Private Sub Workbook_Open()
    ' Automatically initializes everything when the workbook is opened.
    Call InitializeFullEmailTracker
    Call AutoBackupScheduler ' Starts the backup process automatically.
End Sub

' --- AutoBackup Scheduler (Hourly Backup) ---
Sub AutoBackupScheduler()
    Application.OnTime Now + TimeValue("01:00:00"), "AutoBackup" ' Schedules backup every hour
End Sub




its showing error in this line

Sub AddEmailToList()