Excel QueryTable Mystery

I have a QueryTable Object on the Excel spreadsheet. It always works when I use the External Data menu to refresh it. It will only work at the first refresh when I use the VBA to refresh it. The code is the following.


The good news is I figure out a workaround solution. By specifying the parameter, the same QueryTable works.

ActiveSheet.QueryTables(1).Refresh BackgroundQuery:=False


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s