• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

VB, refreshing data in hidden sheet

mr_hiboy

Member
Hi all,


Hopefully a simple one to resolve.


I have a hidden sheet, SearchData12, and I am using the following to update the date.


ActiveWorkbook.Worksheets("SearchData12").Range("C11").QueryTable.Refresh BackgroundQuery:=False


I use it in exactly the same way in another file and if works fine, but I'm getting this error with this file.


Application-defined or object-defined error


Thanks in advance for your help
 
Try this code : Unhide the sheet, activate it, Run your query and hide again. If it is still a problem, then you will have to check your querytable.


With ActiveWorkbook.Worksheets("SearchData12")

.Visible = True

.Activate

.Range("C11").QueryTable.Refresh BackgroundQuery:=False

.Visible = False

End With
 
Hi Lohith, I used to do it that way, until I learned this new way which is a little slicker.


It works fine on another file. And refreshing the query manually works.


A bit of anomaly.


Cheers anyway
 
Back
Top