Bonjour,
j'ai une macro qui me sert à importer des données depuis un fichier texte.
Mon souci vient du fait que le fichier texte doit avoir le même nom à chaque fois, sinon l'importation ne se fait pas.
Y-a-t'il une astuce pour demander à chaque importation de choisir le fichier ?
Merci d'avance
voici mon code
'Importation
Range("B2").Select
With ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;C:\Users\xxxxx\Desktop\Documents and c4 porte_14-10-11_.TXT", _
Destination:=Range("$B$2"))
.Name = "Documents and c4 porte_14-10-11__10"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = 850
.TextFileStartRow = 2
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = False
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = True
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(1, 9, 1, 9)
.TextFileDecimalSeparator = "."
.TextFileTrailingMinusNumbers = True
.Refresh BackgroundQuery:=False
End With