LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Please Help.


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

--
ikiri
-----------------------------------------------------------------------
ikirin's Profile: http://www.excelforum.com/member.php...fo&userid=3559
View this thread: http://www.excelforum.com/showthread.php?threadid=55573

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 09:10 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"