exportacion txt a excel
Publicado por straus (6 intervenciones) el 04/11/2009 17:10:16
cordial saludo ingenieros solicito su colaboracion a lo siguiente formula :
tengo un archivo de texto ( 'Disparo_U3_22_10_09_v1. txt)
y requiero pasar los datos o exportarlos a una hoja en excel de nombre "pruebas" con los requerimientos exigidos por texto en columnas pero me aparecen un error. o estare aplicando mal la formula...???
agradezco me puedan colaborar con este problemita
Private Sub CommandButton1_Click()
Dim prueba As String
prueba = Sheets("Hoja1").Range("A1").Value
With ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;F:/prueba/" & Disparo_U3_22_10_09_v1 & ". txt", Destination:=Range("A1"))
.Name = prueba
.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 = 1
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = True
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = False
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)
.TextFileTrailingMinusNumbers = True
.Refresh BackgroundQuery:=False
End With
End Sub
tengo un archivo de texto ( 'Disparo_U3_22_10_09_v1. txt)
y requiero pasar los datos o exportarlos a una hoja en excel de nombre "pruebas" con los requerimientos exigidos por texto en columnas pero me aparecen un error. o estare aplicando mal la formula...???
agradezco me puedan colaborar con este problemita
Private Sub CommandButton1_Click()
Dim prueba As String
prueba = Sheets("Hoja1").Range("A1").Value
With ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;F:/prueba/" & Disparo_U3_22_10_09_v1 & ". txt", Destination:=Range("A1"))
.Name = prueba
.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 = 1
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = True
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = False
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)
.TextFileTrailingMinusNumbers = True
.Refresh BackgroundQuery:=False
End With
End Sub
Valora esta pregunta


0