In my macro I am running a webquery. as part of the query, the user must
log into the server. No problem here except when the user chooses "Cancel"
then the app crashes on this line ".Refresh BackgroundQuery:=False".

How can I read if the user clicked "Cancel" instead of "Ok" on the connect
dialouge box so I can prevent the attempt to "Refresh"?

I would like to do something similar to the "MsgBox", that is handle the
response more gracefully. Here is the subject code:

With ActiveSheet.QueryTables.Add(Connection:= _
cURL, Destination:=Range("A1"))
.Name = "DataQry"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlEntirePage
.WebFormatting = xlWebFormattingNone
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With