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 quot;The update failedquot;
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:= _
quot;URL;www.domain.com/version.txtquot;,
Destination:=Range(quot;C14quot;))
.Name = quot;testquot;
.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 quot;The update failedquot;
End Sub--
jgmiddel
------------------------------------------------------------------------
jgmiddel's Profile: www.excelforum.com/member.php...oamp;userid=32714
View this thread: www.excelforum.com/showthread...hreadid=530890Put
Exit Sub
on the line before ErrorMessage:
--
Jim
quot;jgmiddelquot; gt; 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 quot;The update failedquot;
| 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:= _
| quot;URL;www.domain.com/version.txtquot;,
| Destination:=Range(quot;C14quot;))
| Name = quot;testquot;
| 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 quot;The update failedquot;
| End Sub
|
|
| --
| jgmiddel
| ------------------------------------------------------------------------
| jgmiddel's Profile:
www.excelforum.com/member.php...oamp;userid=32714
| View this thread: www.excelforum.com/showthread...hreadid=530890
|
- Sep 29 Fri 2006 20:09
Update from TXT-file
close
全站熱搜
留言列表
發表留言