Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default 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
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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2007 convert into tab delimeter text file with extra tab spa Naresh kumar[_2_] Excel Discussion (Misc queries) 0 March 30th 10 03:48 PM
Converting excel 2007 to tab delimeter text file Naresh kumar Excel Discussion (Misc queries) 1 March 27th 10 03:56 PM
Save Excel file to CSV with quotation mark data delimeter? Eric Excel Discussion (Misc queries) 2 December 9th 08 04:05 PM
Macro Import Text File, File Name Bob S[_3_] Excel Programming 2 March 23rd 06 10:01 PM
macro for import of csv .txt file? Ryan Cain Excel Programming 1 August 5th 05 05:43 AM


All times are GMT +1. The time now is 06:04 AM.

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

About Us

"It's about Microsoft Excel"