Insert one sheet with name "Secret" to your workbook, then use the below code for your workbook.

In the thisworkbook objects:
Code:
Private Sub Workbook_Open()

Call Internet_Connectivity

If Sheets("secret").Range("c1").Value = "Connected" Then
ThisWorkbook.Close   ' close the Workbook
End If

End Sub
In standard module:
Code:
Private Declare Function InternetGetConnectedState _
   Lib "wininet.dll" (ByRef dwflags As Long, _
   ByVal dwReserved As Long) As Long
Private Const INTERNET_CONNECTION_MODEM As Long = &H1
Private Const INTERNET_CONNECTION_LAN As Long = &H2
Private Const INTERNET_CONNECTION_PROXY As Long = &H4
Private Const INTERNET_CONNECTION_OFFLINE As Long = &H20
Function IsInternetConnected() As Boolean
    Dim L As Long
    Dim R As Long
    R = InternetGetConnectedState(L, 0&)
    If R = 0 Then
        IsInternetConnected = False
    Else
        If R <= 4 Then
            IsInternetConnected = True
        Else
            IsInternetConnected = False
        End If
    End If
End Function
'You would call this in your code with something like
 
Sub Internet_Connectivity()
    If IsInternetConnected() = True Then
         'MsgBox "Internet is Connected, the workbook shall be closed"
         Sheets("secret").Range("c1").Value = "Connected"
    Else
        Sheets("secret").Range("c1").Value = "Not Connected"
    
    End If
End Sub
Hope this shall help you with some of your requirements.

Thanks!