I am creating an operating system and there will be updates. I want VBA to check if there is an active Internet connection through WiFi or Ethernet. If the check is successful, then it sends you to a certain slide, but if it failed, then it sends you to another slide
This is the code I tried and it's not working:
Private Function IsInternetConnected(Optional SupressMessage As Boolean) As Boolean
Dim objHTTP As Object
'Test for Internet Connection
If IsInternetConnected = True Then
ActivePresentation.SlideShowWindow.View.GotoSlide 3
End
'Report to User if Internet Connection not detected
If IsInternetConnected = False And SupressMessage = False Then
ActivePresentation.SlideShowWindow.View.GotoSlide 2
End If
End Function

I managed to make the code work. The only thing I had to do, not specified anywhere, was to add a shape to which I assigned the action that would start the macro. Here is the code:
To start the code, it must be automated with a module that calls the macro.