Hi, I'm looking for some help with the following:

The goal:
I've got multiple identical files ("UserBook") which are used by separate users. One specific copy of the same file ("MasterBook") is located on a shared drive. Each time a specific worksheet within MasterBook is updated, I need all the UserBook files to reflect the changes.

My attempt:
I've got it pretty much figured out. In each of the user files, upon Workbook_Open() I have it compare the date it was last updated (which it gets from a cell value on the worksheet) with the modification date of the master file. If the master file has been modified since the last time the user file was updated, then delete the specific worksheet on the userfile and replace it with the same worksheet from the MasterBook.

The problem:
Even though the UserBook worksheet is deleted BEFORE the MasterBook worksheet is copied over, the worksheet's CodeName is still changed from "wsTheList" to "wsTheList1". This is unacceptabe due to the CodeName being heavily used throughout the rest of the program.

My Code:
Sub UpdateTheList()
    Dim LastUpdated As Date         'The last time the user's file was updated.
    Dim MasterDate As Date          'The last time the master file was modified.
    Dim MasterFilePath As String    'The location of the master file.
    Dim MasterFileName As String    'The filename of the master file.
    Dim UserBook As Workbook        'The user's copy of the file.
    Dim MasterBook As Workbook      'The master copy of the file.
    Dim SheetIndex As Integer       'The index number of the worksheet being replaced.

'Note:  "wsTheList" is the CodeName of the worksheet being replaced.
    
    MasterVerseFilePath = "C:\Master File\"
    MasterVerseFileName = "MasterFile.xlsm"
    MasterDate = Format(FileDateTime(MasterFilePath & MasterFileName), "yyyy-mm-dd")
    LastUpdated = Format(wsTheList.Range("D2").Value, "yyyy-mm-dd")
    
'Compare the dates.
    If MasterDate > LastUpdated Then    'If the worksheet needs to be updated...
        Application.ScreenUpdating = False
        wsTheList.Activate                  'Go to the worksheet that is being replaced.
        Set UserBook = ActiveWorkbook       'Identify the user's file.
        SheetIndex = wsTheList.Index        'Mark the location of the existing wsTheList worksheet.
        Workbooks.Open (MasterFilePath & MasterFileName)    'Open the master file.
        Set MasterBook = ActiveWorkbook     'Identify the master file.
'Delete the old worksheet in the user's file.
        UserBook.Activate                   'Go back to the user's file.
        Application.EnableEvents = False
        Application.DisplayAlerts = False
        wsTheList.Delete
        Application.DisplayAlerts = True
        Application.EnableEvents = True
'Copy the worksheet from the master file to the user's file.
        MasterBook.Worksheets(Code2Name(MasterBook, "wsTheList")).Copy Before:=UserBook.Sheets(SheetIndex)
        MasterBook.Close False  'Close the Master file, do not save changes.
        wsTheList.Unprotect "LockItUp"
        wsTheList.Range("D2") = Format(Now(), "mmmm d, yyyy")    'Update the "Last Updated" date.
        wsTheList.Protect "LockItUp"
'Cleanup.
        Set UserBook = Nothing      'Uninitialize
        Set MasterBook = Nothing    'Uninitialize
        Application.StatusBar = False   'Return control of the Status Bar to Excel.
        Application.ScreenUpdating = True
    End If
End Sub
I tried changing the CodeName before deleting the worksheet:
'I replaced this line
        wsTheList.delete

'With these two lines
        ThisWorkbook.VBProject.VBComponents("wsTheList").Name = "DeleteThis"
        UserBook.Worksheets(Code2Name(UserBook, "DeleteThis")).Delete
This worked great and I thought I was done... but once the VBProject is password protected, this no longer works.

Any help on this would be much appreciated. I feel like I'm missing something simple...