Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]() Hi, some help would appriciated. I would like to check some data in a TXT-file. If the worksheet is on a computer without internet-connection, the messagebox "The update failed" should appear. But, in the macro I made, the messagebox always appears, also when the update is done. What am I doing wrong? Sub CheckUpdate() On Error GoTo ErrorMessage With ActiveSheet.QueryTables.Add(Connection:= _ "URL;http://www.domain.com/version.txt", Destination:=Range("C14")) .Name = "test" .FieldNames = True .RowNumbers = False .FillAdjacentFormulas = False .PreserveFormatting = True .RefreshOnFileOpen = False .BackgroundQuery = True .RefreshStyle = xlInsertDeleteCells .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 ErrorMessage: MsgBox "The update failed" End Sub -- jgmiddel ------------------------------------------------------------------------ jgmiddel's Profile: http://www.excelforum.com/member.php...o&userid=32714 View this thread: http://www.excelforum.com/showthread...hreadid=530890 |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Put
Exit Sub on the line before ErrorMessage: -- Jim "jgmiddel" wrote in message ... | | Hi, some help would appriciated. | | I would like to check some data in a TXT-file. If the worksheet is on a | computer without internet-connection, the messagebox "The update failed" | should appear. But, in the macro I made, the messagebox always appears, | also when the update is done. What am I doing wrong? | | Sub CheckUpdate() | On Error GoTo ErrorMessage | With ActiveSheet.QueryTables.Add(Connection:= _ | "URL;http://www.domain.com/version.txt", | Destination:=Range("C14")) | Name = "test" | FieldNames = True | RowNumbers = False | FillAdjacentFormulas = False | PreserveFormatting = True | RefreshOnFileOpen = False | BackgroundQuery = True | RefreshStyle = xlInsertDeleteCells | 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 | ErrorMessage: | MsgBox "The update failed" | End Sub | | | -- | jgmiddel | ------------------------------------------------------------------------ | jgmiddel's Profile: http://www.excelforum.com/member.php...o&userid=32714 | View this thread: http://www.excelforum.com/showthread...hreadid=530890 | |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Hyperlink won't open any other XLS file | Excel Discussion (Misc queries) | |||
update a closed file via links | Excel Discussion (Misc queries) | |||
Automatically update from source when file opens | Excel Discussion (Misc queries) | |||
Excel-What is update file tool? | Excel Discussion (Misc queries) | |||
Read Text File into Excel Using VBA | Excel Discussion (Misc queries) |