Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
unique error 400 only if internet not accessible
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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Error Message in saving internet sites into Favourites | Excel Discussion (Misc queries) | |||
Run-Time Error 91 for Internet Explorer .elements(name).value | Excel Programming | |||
error in script from internet explorer | Excel Discussion (Misc queries) | |||
Excel macro error when opened in internet browser | Excel Programming | |||
How to trap the error message "Remote Data not accessible"? | Excel Programming |