Please Help.

I

ikirin

Ok i am trying to open 4 files. Kiro1, Kiro2, Kiro3, Kiro4. I want t
open tham one after another, one below another. This is a code i haw
and i am getting an erron where the code is bold. I do not know what t
do. Please help.

Private Sub btnCombine_Click()

Dim intLastrow
Dim strFirstFileName
Dim strInput
Dim intX

intLastrow = Cells(65536, 1).End(xlUp).Row

strFirstFileName = Application.GetOpenFilename

txtFirstFileName.Text = strFirstFileName


For intX = 1 To 4

strInput = Right(strFirstName, 3)


With ActiveSheet.QueryTables.Add(Connection:="TEXT;" & strInput
intX, _
Destination:=Cells(intLastrow + intX, 1))
.Name = "Kiro" & intX & ".dat"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = 437
.TextFileStartRow = 1
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = True
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = True
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, _
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)
.TextFileTrailingMinusNumbers = True
* .Refresh BackgroundQuery:=False*
End With
Next intX

End Sub

Thanks for any help
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top