Macro to Refresh External data

G

Guest

Good afternoon,

I try to record a macro to refresh external data but the macro recorder does
not give me anything once I refresh the query and stop the recording.
Does anyone knows why?
Or better if you know the VBA to make this happen -even when the data sheet
is hidden- let me know.

Thanks in advance and greetings from south Fla.
 
E

Earl Kiosterud

Apprentice,

This is the code the recorder generated when I tried a refresh on a text file import.

Range("A1").Select
Selection.QueryTable.Refresh BackgroundQuery:=False

You'd probably change it to something like:

Range("A1").QueryTable.Refresh BackgroundQuery:=False
--
Earl Kiosterud
www.smokeylake.com

Note: Some folks prefer bottom-posting. But if you bottom-post to a reply that's already
top-posted, the thread gets messy. When in Rome...
 

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

Top