-
Solved: import empty column QueryTables thnks
Hi, Im trying to import some txt file with "PIPE" delimiters to excel worksheet but it does not imports a blank columns .
I need to import all columns does not matter if they are empty.
I hope, you can help me
[vba]
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
[/vba]
Last edited by abdelyasid; 06-14-2010 at 01:33 AM.
-
example file
NumFactura|Referencia1|Referencia2|Referencia3|Referencia4|Importe Bruto|Descuentos/Recargos|Importe Neto|Medio de Pago|Forma de Pago|Folio de Pago|Sucursal|Hora|Fecha Vencimiento|Fecha de Pago
72770|0000000000000000000000000000000101800225|001 |||$0.10|$0.00|$0.10|Ventanilla|Efectivo|13940139031268072770 |1394|09:17:01 a.m.|00/00/0000|19/05/2010
72770|0000000000000000000000000000000015103633|002 |||$0.10|$0.00|$0.10|Ventanilla|Efectivo|13940139032134072770 |1394|09:17:47 a.m.|00/00/0000|19/05/2010
72770|0000000000000000000000000000000016303828|003 |||$0.10|$0.00|$0.10|Ventanilla|Efectivo|13940139032836072770 |1394|09:18:30 a.m.|00/00/0000|19/05/2010
72770|0000000000000000000000000000000027605492|004 |||$0.10|$0.00|$0.10|Ventanilla|Efectivo|13940139033308072770 |1394|09:18:54 a.m.|00/00/0000|19/05/2010
htt... img20.imagevenue.com/img.php?image=98114_txt_122_22lo.JPG
htt..ww... easy-share.com/1910949476/file pipe delimited.txt
sorry for the 60 seconds to wait
Last edited by abdelyasid; 06-14-2010 at 12:28 AM.
-
I can't test quickly, but would it help to change
[vba].TextFileConsecutiveDelimiter = True
to[/vba] [vba].TextFileConsecutiveDelimiter = False[/vba] ?
p45cal
Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.
-
Solved
Thanks a lot p45cal
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules