Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro to import delimeter file
I have created a macro to import a text file from our server (H: drive) but
whenever i run the macro it asks me to select the file from the Import Text File window. I want to run the macro and for it to automatically load the same text file into the spreadsheet every time without any user interaction. The code created for my macro is shown below. Range("A2").Select With Selection.QueryTable .Connection = "TEXT;H:\projects\quality database\qextract.txt" .TextFilePlatform = xlWindows .TextFileStartRow = 1 .TextFileParseType = xlDelimited .TextFileTextQualifier = xlTextQualifierDoubleQuote .TextFileConsecutiveDelimiter = False .TextFileTabDelimiter = False .TextFileSemicolonDelimiter = True .TextFileCommaDelimiter = False .TextFileSpaceDelimiter = False .TextFileColumnDataTypes = Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1) .Refresh BackgroundQuery:=False Any help greatly appreciated. David |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel 2007 convert into tab delimeter text file with extra tab spa | Excel Discussion (Misc queries) | |||
Converting excel 2007 to tab delimeter text file | Excel Discussion (Misc queries) | |||
Save Excel file to CSV with quotation mark data delimeter? | Excel Discussion (Misc queries) | |||
Macro Import Text File, File Name | Excel Programming | |||
macro for import of csv .txt file? | Excel Programming |