2023-01-24

Need advice with Error Handling for Invalid Path

I could use some advice on how to handle a strange issue that happens to my users.

Issue: All of my users are on laptops that use VPN to connect to our network. When they disconnect from the VPN and reconnect the network drive also disconnects till they open the drive or folder through file explorer. When this happens and they don't re-establish the connection to the network drive they end up with 3304 error.

Error Handling? What I'd like to do is setup some sort of error handler to tell them thats what happened with a potential link they could click on to re establish the connection. OR even better just have the VBA code identify that error 3304 has occurred and re-establish the connection automatically for them and no pop up error happen at all.

Has anyone done this? I've done some research but nothing I've found quite fits the criteria for this issue. Looking for any advice or push in the right direction.

I was thinking of something like this where either they get a pop up with a link or skip the pop up all together and find a way to re-connect the drive in the background.

On Error GoTo ErrHandler

'Error Handler
ErrHandler:
If Err.Number = 3304 Then

MsgBox "Error Number:" & Err.Number & vbCrLf & _
    "Error Description: " & Err.Description & vbCrLf & _
    "This error is due to your VPN being disconnected and reconnected"
Else
End If 


No comments:

Post a Comment