abdelyasid
06-13-2010, 11:52 PM
Hi, Im trying to import some txt file with "PIPE" delimiters to excel worksheet but it does not imports a blank columns :think: .
I need to import all columns does not matter if they are empty.
I hope, you can help me
rutaTxt = "TEXT;" & rutaTxt
With ActiveSheet.QueryTables.Add(rutaTxt, celdaInicial)
.Name = "B_TXT"
.AdjustColumnWidth = False
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlOverwriteCells
.SavePassword = False
.SaveData = True
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = xlMSDOS
.TextFileStartRow = 1
.TextFileParseType = xlDelimited
.TextFileOtherDelimiter = "|"
.TextFileTextQualifier = xlTextQualifierNone
.TextFileConsecutiveDelimiter = True
.TextFileTabDelimiter = False
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = False
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(xlGeneralFormat, xlGeneralFormat, xlTextFormat, _
xlGeneralFormat, xlGeneralFormat, xlGeneralFormat, xlGeneralFormat, xlGeneralFormat, _
xlTextFormat, xlTextFormat, xlTextFormat, xlTextFormat, _
xlTextFormat, xlDMYFormat, xlDMYFormat)
.Refresh
I need to import all columns does not matter if they are empty.
I hope, you can help me
rutaTxt = "TEXT;" & rutaTxt
With ActiveSheet.QueryTables.Add(rutaTxt, celdaInicial)
.Name = "B_TXT"
.AdjustColumnWidth = False
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlOverwriteCells
.SavePassword = False
.SaveData = True
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = xlMSDOS
.TextFileStartRow = 1
.TextFileParseType = xlDelimited
.TextFileOtherDelimiter = "|"
.TextFileTextQualifier = xlTextQualifierNone
.TextFileConsecutiveDelimiter = True
.TextFileTabDelimiter = False
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = False
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(xlGeneralFormat, xlGeneralFormat, xlTextFormat, _
xlGeneralFormat, xlGeneralFormat, xlGeneralFormat, xlGeneralFormat, xlGeneralFormat, _
xlTextFormat, xlTextFormat, xlTextFormat, xlTextFormat, _
xlTextFormat, xlDMYFormat, xlDMYFormat)
.Refresh