Se a firewall do windows não bloquear será;
Num modulo novo, cole e salve:
Option Explicit
Public Function EnviaParaMensageiroWindows(command As String, Optional ByVal keepAlive As _
Boolean = False, Optional windowState As VbAppWinStyle = VbAppWinStyle.vbHide) _
As Boolean
On Error GoTo Err_Hnd
Const lngMatch_c As Long = 0
Const strCMD_c As String = "cmd.exe"
Const strComSpec_c As String = "COMSPEC"
Const strTerminate_c As String = " /c "
Const strKeepAlive_c As String = " /k "
Dim strCmdPath As String
Dim strCmdSwtch As String
If keepAlive Then
If windowState = vbHide Then
windowState = vbNormalFocus
End If
strCmdSwtch = strKeepAlive_c
Else
strCmdSwtch = strTerminate_c
End If
strCmdPath = VBA.Environ$(strComSpec_c)
If VBA.StrComp(VBA.Right$(strCmdPath, 7), strCMD_c, vbTextCompare) <> _
lngMatch_c Then
strCmdSwtch = vbNullString
End If
VBA.Shell strCmdPath & strCmdSwtch & command, windowState
EnviaParaMensageiroWindows = True
Exit Function
Err_Hnd:
EnviaParaMensageiroWindows = False
End Function
Public Sub TestEnviaParaMensageiroWindows()
Const lngCancelled_c As Long = 0
Dim strCmd As String
strCmd = "net send nomedamáquinanarede mensagem" ' coloque aqui o nome do computador e mensagem
If VBA.LenB(strCmd) = lngCancelled_c Then
Exit Sub
End If
EnviaParaMensageiroWindows strCmd, True
End Sub
No evento ao pressionar do seu botão:
Private Sub SeuBotao_Click()
TestEnviaParaMensageiroWindows
End Sub