lese ich bei öffnen einer Mappe Daten ein, die tägl. aktualisiert
werden. Ich hätte nun gerne das Excel das alleine, einmal oder zweimal pro Tag tut. Gibt es hierfür eine Möglichkeit ?
Oder hat jemand eine Idee ?
#####################################################
Private Sub Workbook_Open()
'Liest die ISH Daten ein
On Error Resume Next
ActiveSheet.QueryTables("BESTAND").Refresh
If Err.Number > 0 Then 'Falls Query noch nicht existiert...
With ActiveSheet.QueryTables.Add(Connection:="TEXT;G:\Test\BESTAND.txt", _
Destination:=Range("A2"))
.Name = "BESTAND"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = True
.RefreshStyle = xlOverwriteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 360
.TextFilePromptOnRefresh = False
.TextFilePlatform = xlWindows
.TextFileStartRow = 1
.TextFileParseType = xlFixedWidth
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = True
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = False
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(9, 1, 1, 9, 1, 1, 1, 1, 9, 1, 9, 1, 1, 1)
.TextFileFixedColumnWidths = Array(3, 7, 1, 2, 8, 1, 30, 30, 2, 6, 2, 6, 8)
.Refresh BackgroundQuery:=False
End With
End If
Range("K1").Select
End Sub
########################
Gruß Ingo