![]() |
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 |
All times are GMT +1. The time now is 03:30 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com