Bonjour,
Sauf erreur de ma part, il semble que la propriété TextFileTabDelimiter de l'objet QueryTable n'est pas à False par défaut, contrairement à ce qu'indique l'aide d'Excel.
Du moins c'est ce que je comprends. Dans mon code ci-dessous, j'avais spécifié TextFileSemicolonDelimiter à True comme souhaité, sans explicitement mettre TextFileTabDelimiter = False.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| With wbAdm.Worksheets(cstShName_ImportGL).QueryTables.Add(Connection:="TEXT;" & gFGL.FullName, Destination:=wbAdm.Worksheets(cstShName_ImportGL).Range("$A$1"))
.Name = "Source"
.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
.TextFileSemicolonDelimiter = True
.TextFileColumnDataTypes = lFormatCol
.TextFileTrailingMinusNumbers = True
.TextFileDecimalSeparator = ","
.Refresh BackgroundQuery:=False
End With |
Dans la pratique, j'ai quelques lignes qui comportent des tabulations ... qu'Excel a interprété comme étant un séparateur
.
Plus de problème en définissant explicitement cette propriété.
.TextFileTabDelimiter = False
Je me demande s'il s'agit d'un bug ou si j'interprète mal la notion de 'valeur par défaut' indiquée dans l'aide.
Partager