bobbydaonlybuilder
New Member
- Joined
- Sep 24, 2020
- Messages
- 5
- Office Version
- 365
- 2016
- Platform
- Windows
HI All,
So ive a query that runs
//runqry bring back data
//refresh existing activeworkbook.connection (which always uses the same table name "MYTABLE"
then im trying to run the code.. oops sorry missed a bit, I do the following command before the query refresh
Set tbl = Sheets(1).ListObjects("MYTABLE")
tbl.TotalsRowRange.Delete
to remove existing table totals
back to after connection refreshed i try this
Sheets(1).ListObjects("MYTABLE").ShowTotals = True
With Sheets(1).ListObjects("MYTABLE")
' Ive even tried this to no avail....Application.Wait Now() + TimeValue("00:00:03")
.ListColumns("Amount").TotalsCalculation = xlTotalsCalculationSum
It fails everytime with runtime error.. if i hit debug i can then step through it no problem and it works.. it just doesnt exist when the whole thing runs in real time
ANy ideas?
Regards
James
So ive a query that runs
//runqry bring back data
//refresh existing activeworkbook.connection (which always uses the same table name "MYTABLE"
then im trying to run the code.. oops sorry missed a bit, I do the following command before the query refresh
Set tbl = Sheets(1).ListObjects("MYTABLE")
tbl.TotalsRowRange.Delete
to remove existing table totals
back to after connection refreshed i try this
Sheets(1).ListObjects("MYTABLE").ShowTotals = True
With Sheets(1).ListObjects("MYTABLE")
' Ive even tried this to no avail....Application.Wait Now() + TimeValue("00:00:03")
.ListColumns("Amount").TotalsCalculation = xlTotalsCalculationSum
It fails everytime with runtime error.. if i hit debug i can then step through it no problem and it works.. it just doesnt exist when the whole thing runs in real time
ANy ideas?
Regards
James