Hi,

I can't see what is wrong with the below code?

Dim wb As Workbook
dpworkbook = ThisWorkbook.Name

If wb.Name <> dpworkbook Then
    Application.DisplayAlerts = False
        wb.Close
    Application.DisplayAlerts = True
End If