Seamus2626
asked on
Refresh Data Query error
Hi,
I am trying to refresh an OLE DB query with some code.
I get the attached error whenever i run it my routine. The line of code it breaks on is
Selection.QueryTable.Refre sh BackgroundQuery:=False
I can phsyically refresh it on the spreadsheet, just not in the code.
Does anyone know why this is?
Thanks
Seamus
Doc1.doc
I am trying to refresh an OLE DB query with some code.
I get the attached error whenever i run it my routine. The line of code it breaks on is
Selection.QueryTable.Refre
I can phsyically refresh it on the spreadsheet, just not in the code.
Does anyone know why this is?
Thanks
Seamus
Doc1.doc
ASKER
Heres my complete code, the sheet is called Raw Data, can you suggest?
Thanks
Seamus
Sheets("Raw Data").Visible = True
Sheets("Raw Data").Select
Range("a22").Select
Selection.QueryTable.Refre sh BackgroundQuery:=False
Range("a24").Select
Sheets("Screen").Select
Thanks
Seamus
Sheets("Raw Data").Visible = True
Sheets("Raw Data").Select
Range("a22").Select
Selection.QueryTable.Refre
Range("a24").Select
Sheets("Screen").Select
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Good man!
ActiveWorkbook.RefreshAll
That worked
Cheers,
Seamus
ActiveWorkbook.RefreshAll
That worked
Cheers,
Seamus
HTH,