Hi,
I have a hidden datasheet linked to sql server table.
On my report sheet i have a button that unhides the data sheet, selects a cell and run background refresh, then hides the data sheet again.
Am I able to run the data refresh without un-hiding the sheet (so it's visible to the end user.
Code looks like this.
[pre]
[/pre]
I don't want to use any of the data update options as it needs to be updated on demand.
Cheers
I have a hidden datasheet linked to sql server table.
On my report sheet i have a button that unhides the data sheet, selects a cell and run background refresh, then hides the data sheet again.
Am I able to run the data refresh without un-hiding the sheet (so it's visible to the end user.
Code looks like this.
[pre]
Code:
Sheets("Data").Visible = True
Sheets("Data").Select
Range("E8").Select
Selection.QueryTable.Refresh BackgroundQuery:=False
Was hoping something like this would work?
ActiveWorkbook.Worksheets("Data").Range("E8").Select
Selection.QueryTable.Refresh BackgroundQuery:=False
I don't want to use any of the data update options as it needs to be updated on demand.
Cheers