Share via

Excel 2010 QueryTable.Refresh Error - Manual Refresh works

Anonymous
2016-10-01T23:45:59+00:00

The code below returns "Run-time error '1004': Applicatoin-defined or object-defined error":

Worksheets("DataSB").Range("B4").QueryTable.Refresh BackgroundQuery:=False

However, if I click cell B4 and manually refresh the sheet via Data>Refresh, it refreshes just fine.  The worksheet name is correct in the code. 

Another odd thing is that even though the data refreshes successfully when I manually refresh, if I go to Data>Connections and open the Workbook Connections dialog, this connection is blank for "Last Refreshed" date/time, while 3 other connections in the workbook do have date/times listed that update each time they are refreshed.  This connection is to a table in an Access 2010 database.

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

1 answer

Sort by: Most helpful
  1. Anonymous
    2016-10-02T19:09:45+00:00

    Hi, 

    The concern that you have is more complex than what is typically answered in the Microsoft Answers forum. We suggest you to post your concern in this link.

    Before posting using the given link, follow the steps below: 

    1. Select Community.
    2. Select Forums.
    3. Select View All.
    4. Type in Excel then select the appropriate category.

    Regards.

    Was this answer helpful?

    0 comments No comments