Åben fil med VBA
Jeg har en fil som jeg læser ind i excel via dataimport, hvilket fungerer fint så længe filen hedder okt07...Nu vil jeg gerne have indbygget en "åben fil" dialogbox i min macro, således at jeg selv kan udpege filen
Macroen ser således ud:
_______________________________________
Sub HentPosteringer()
With ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;C:\Documents and Settings\ats\My Documents\Privat\Økonomi\okt07.", _
Destination:=Range("A1"))
.Name = "okt07"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = 1252
.TextFileStartRow = 1
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = False
.TextFileSemicolonDelimiter = True
.TextFileCommaDelimiter = False
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(4, 2, 1, 9, 9, 9, 1, 1)
.TextFileTrailingMinusNumbers = True
.Refresh BackgroundQuery:=False
End With
End Sub
__________________________________________
Er der nogen som kan tilrette min macro?