Sorry, but I just cant work this one out.
I am updating an old workbook which has an MS Query created before Tables were fasionable.
It was updated as part of a macro
works fine.
I wanted to add some data so have recreated the MSQueries (and added 2 new ones) and they are now presented as tables.
I have recorded the mouse clicks used to update them but the code it produces shows it has a syntax error.
1. There is a space between QueryTable. & BackgroundQuery
2. It doesn't like the ":" in the ":="
If I change these to remove the syntax error it runs through the code but doesn't update the table.
this is what I have to update the three tables.....
any help would be appreciated.
I am updating an old workbook which has an MS Query created before Tables were fasionable.
It was updated as part of a macro
VBA Code:
Sheets("Cost Calc").Range("A5").QueryTable.Refresh BackgroundQuery:=False
works fine.
I wanted to add some data so have recreated the MSQueries (and added 2 new ones) and they are now presented as tables.
I have recorded the mouse clicks used to update them but the code it produces shows it has a syntax error.
VBA Code:
Selection.ListObject.QueryTable. BackgroundQuery := FALSE
1. There is a space between QueryTable. & BackgroundQuery
2. It doesn't like the ":" in the ":="
If I change these to remove the syntax error it runs through the code but doesn't update the table.
this is what I have to update the three tables.....
VBA Code:
With Sheets("Cost Calc")
Range("A4").ListObject.QueryTable.BackgroundQuery = False
Range("A8").ListObject.QueryTable.BackgroundQuery = False
Range("A11").ListObject.QueryTable.BackgroundQuery = False
End With
any help would be appreciated.