Annoying Dialog Box

  • Thread starter Thread starter jason
  • Start date Start date
J

jason

In cell "A1" I've created a Query using the wizard that simply imports
the contents of a Text file.
I've now recorded a macro to update this query:

Range("A1").QueryTable.Refresh BackgroundQuery:=True

and I've also tried:

Application.DisplayAlerts = False
Range("A1").QueryTable.Refresh BackgroundQuery:=True
Application.DisplayAlerts = True

When I run either of these and annoying dialog box appears named
"Import Text File" and I have to press "Import" for the macro to
continue

Anyone any ideas how to get rid of this, or am I up againsta
brickwall?
(there is a workaround but I'd rather plow straight ahead)

Any help greatly appreciated
Jason
 
Before you refresh your data (or even when you originally create the
query) set the following Data Range Property (it's very long name
describes exactly what it is)

Range("A1").QueryTable.TextFilePromptOnRefresh = True
 
I cannot duplicate, but sounds like the macro security
level may be invoking the popup.

Try lowering the Macro Security Level
tools...macro..security.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top