Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I get this error all the time. I ma trying to open bunch of DAT files and stack tham in the excel sheet one after other. And i get this message. When i am opening only one file it works fine, when i want to do a for loop to go to the las file i specified it gives me this error ".Refresh BackgroundQuery:=False" Please Help. This is my code. Private Sub CommandButton1_Click() Dim intLastrow Dim strFirstFileName Dim intKiro intLastrow = Cells(65536, 1).End(xlUp).Row strFirstFileName = Application.GetOpenFilename For intKiro = 0 To CInt(txtLastFileNumber.Text) With ActiveSheet.QueryTables.Add(Connection:="TEXT;" & strFirstFileName, Destination:=Cells(intLastrow + 1, 1)) ..Name = "BENT 2 -Final00" & intKiro ..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 intKiro End Sub -- ikirin ------------------------------------------------------------------------ ikirin's Profile: http://www.excelforum.com/member.php...o&userid=35599 View this thread: http://www.excelforum.com/showthread...hreadid=555612 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Problems with .Refresh BackgroundQuery:=False | Excel Programming | |||
Problems with .Refresh BackgroundQuery:=False | Excel Worksheet Functions | |||
Error on refresh backgroundquery - help please | Excel Programming | |||
Web query .Refresh BackgroundQuery:=False problem | Excel Programming | |||
Excel does not close from VB!! (when i refresh Refresh query with BackgroundQuery:=False) | Excel Programming |