View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
NickHK NickHK is offline
external usenet poster
 
Posts: 4,391
Default unique error 400 only if internet not accessible

Mike,
I get a general error 1004 with my net connection unplugged and cannot
reproduce your autorecover problem.
Something else happening also ?

NickHK

"mikeolson" wrote in message
...
I get error code 400 only if the internet is not accessible, otherwise

this
code works fine. I have searched through and no other solutions offered

seem
to address my issue so I am posting it here. If I repeat the macro 3 or 4
times, I get another message stating that autorecover has aborted and I

can
no longer save my workbook. Here's my code:

'Sub CheckUpdate_Macro()
Dim strCompleteURL As String
Const strDefaultURL As String = "URL;http://"

cboPartTwo = Sheets("UPDATE").Range("L1")
cboPartThree = "update.txt"
strCompleteURL = strDefaultURL & cboPartTwo & cboPartThree 'gives
URL;http://www.mywebsite.com/update.txt
Sheets("UPDATE").Select
On Error GoTo ErrorMessage
With ActiveSheet.QueryTables.Add(Connection:= _
strCompleteURL, Destination:=Range("A1"))
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlPasteDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlAllTables
.WebFormatting = xlWebFormattingNone
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With

Exit Sub
ErrorMessage:
MsgBox "The update failed, make sure you are " & _
"connected to the internet."

End Sub
'

Thank you in advance for your help!

Mike