I am using the following code to update web qwery. Since the site
needs password so I use "Remenber me" in the site so that I do not
need to log in again. But the same expires after some days and I
need to relog in. Then the code executes an error. I want that
instead of showing the error msg, the code shall show following msg
"Please visit the web to re log in". Where this message is to put in
the code? Someone should please help!
I have modified the error handler message as shown below, but it is
showing the Message every time the code completes its task, ie
evenif there is no error
Code is given below:
Sub Update()
Application.ScreenUpdating = False
Application.DisplayStatusBar = True
Application.StatusBar = "Please wait while updating..."
Application.Wait Now + TimeValue("00:00:02")
On Error GoTo endo
Sheets("Web").Select
Range("A40").Select
Selection.QueryTable.Refresh BackgroundQuery:=False
Sheets("TOP").Select
Application.StatusBar = False
endo: MsgBox "Please relogin the web"
End Sub