Ping VBA di excel
Untuk ping Private Sub CommandButton1_Click() ip = Me.TextBox1.Text Result = GetPingResult(ip) Label2.Caption = "(" & ip & ") status :" & Result End Sub Function GetPingResult(Host) Dim objPing As Object Dim objStatus As Object Dim strResult As String Set objPing = GetObject("winmgmts:{impersonationLevel=impersonate}"). _ ExecQuery("Select * from Win32_PingStatus Where Address = '" & Host & "'") For Each objStatus In objPing Select Case objStatus.StatusCode Case 0: strResult = "Connected" Case 11001: strResult = "Buffer too small" Case 11002: strResult = "Destination net unreachable" Case 11003: strResult = "Destination host unreachab...