Hi
I'm running a macro that gets a file from the internet. My code is like this: (i got it recording the macro)
It works most of the time, but sometimes seems that the file is not available, and I get a warning message, and the macro stops. I want to treat this and avoid warning message, but nothing works.
I tried
Application.DisplayAlerts = False
also
On Error Resume Next
On Error goto somewhere
but it always show the warning message that the file was not found, and my macro stops.
Is there anything else to do in order to avoid the message?
Thank you
I'm running a macro that gets a file from the internet. My code is like this: (i got it recording the macro)
Code:
With ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;https:// here my url..." _
, Destination:=Sheets("mysheet").Range("$A$1"))
.Name = "the name here"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = False
.RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = False
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = 850
.TextFileStartRow = 1
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = False
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = False
.TextFileSpaceDelimiter = False
.TextFileOtherDelimiter = "},{"
.TextFileTrailingMinusNumbers = True
.Refresh BackgroundQuery:=False
End With
It works most of the time, but sometimes seems that the file is not available, and I get a warning message, and the macro stops. I want to treat this and avoid warning message, but nothing works.
I tried
Application.DisplayAlerts = False
also
On Error Resume Next
On Error goto somewhere
but it always show the warning message that the file was not found, and my macro stops.
Is there anything else to do in order to avoid the message?
Thank you