Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I got it figured out. I recorded the code when I edited the existing
query and it works now. Here is what I came up with. Scott Sub RefreshExistingQuery() 'This code will refresh a existing query with new data from a new file DataFileName = "TEXT;\\ULTRAVISION\Opti information\prodhist \200710\" & Sheets("Sheet1").Cells(3, 1).Text & ".s" With Sheets("Sheet1").Range("D5").QueryTable .Connection = DataFileName .TextFilePlatform = 437 .TextFileStartRow = 1 .TextFileParseType = xlDelimited .TextFileTextQualifier = xlTextQualifierDoubleQuote .TextFileConsecutiveDelimiter = True .TextFileTabDelimiter = True .TextFileSemicolonDelimiter = False .TextFileCommaDelimiter = False .TextFileSpaceDelimiter = True .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) .Refresh BackgroundQuery:=False End With End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
import external data from changing file name | Excel Worksheet Functions | |||
How do I import text file, analyze data, export results, open next file | Excel Programming | |||
Changing only source file of pre-existing text import QueryTable? | Excel Programming | |||
Open delimited text file to excel without changing data in that file | Excel Programming | |||
Get External Data, Import Text File, File name problem | Excel Programming |