I have created a button that imports a specific .csv file into my excel sheet. However, I want to specify which file opens when clicking on the button. So if the button is pressed: Excel opens the explorer and the user can specify which file to open.
With ActiveSheet.QueryTables.Add(Connection:="TEXT;Path\20150728.csv", _
Destination:=Range("$A$1"))
.Name = "Tasks-Job--1g2MZtgw-Feike_15min_data-20150728"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = 932
.TextFileStartRow = 1
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = False
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = True
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)
.TextFileTrailingMinusNumbers = True
.Refresh BackgroundQuery:=False
End With
Columns("A:A").Select
Selection.Delete Shift:=xlToLeft
I tried to implement the following code:
Call Shell("explorer.exe" & " " & "Path", vbNormalFocus)
But I didn't manage to get it working correctly. Any suggestions?