Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Application defined error on external data refresh 1

Status
Not open for further replies.

Mikeauz

Technical User
Jul 23, 2002
75
AU
Hi,

I'm retreiving external data from an Access 2000 db using excel 2000 and sometimes when I use the below code I get the error "Application defined error".

Sheets("Data").Select
Selection.QueryTable.Refresh BackgroundQuery:=False

I can always fix it by manually going to the sheet and selecting refresh but this regularly halts macros that I've written.

Thanks for any help
Mike
 
Try this instead
Sheets("Data").activate
Activesheet.querytables(1).refresh (False)

Rgds, Geoff

Never test the depth of water with both feet

Help us to help you by reading FAQ222-2244 before you ask a question
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top