View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
tmwilkin tmwilkin is offline
external usenet poster
 
Posts: 13
Default Import Text File Window Bypass

I have a macro set up to refresh a delimited .txt file import. However, I
continue to receive the "Import Text File" prompt box and have to select the
file. I would like to bypass this prompt all together by specifying the name
of the file. The guts of the code are below:

With Selection.QueryTable
.Connection = _
"TEXT;J:\Office Records\1 Central Reports and Projects
Folder\Dashboard\Source_files\Presidential Sales violations.txt"
.Refresh BackgroundQuery:=False
End With

I've also tried the .Connection with "TEXT;" & "J:...." and come up with the
same issue - so there must be something I'm doing wrong in calling the file
name. Can someone assist me with this issue?

Thanks,
Todd