View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
Leon Leon is offline
external usenet poster
 
Posts: 67
Default Skipping Import Text File dialog in a Macro

I tried the following but the dialog always appears and forces me to click
the Import button.

Sheets("Sheet1").Select
Application.DisplayAlerts = False
With Selection.QueryTable
.Connection = _
"TEXT;C:\Edrive\standalone\Lineup\18ScorecardRoste r.txt"
.TextFilePlatform = xlWindows
.TextFileStartRow = 1
.TextFileParseType = xlFixedWidth
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = True
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = False
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(2, 2)
.TextFileFixedColumnWidths = Array(4)
.Refresh BackgroundQuery:=False
End With
Sheets("Scorecard-v").Select