sujittalukde
Well-known Member
- Joined
- Jun 2, 2007
- Messages
- 520
I am using the folllowing 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!
"Please visit the web to re log in". Where this message is to put in the code? Someone should please help!
Code:
Sub Update()
Application.ScreenUpdating = False
Application.DisplayStatusBar = True
Application.StatusBar = "Please wait while updating..."
Application.Wait Now + TimeValue("00:00:02")
Sheets("Web").Select
Range("A40").Select
Selection.QueryTable.Refresh BackgroundQuery:=False
Sheets("TOP").Select
Application.StatusBar = False
End Sub