charlie1105
Board Regular
- Joined
- Oct 16, 2007
- Messages
- 182
Hi All, I'm having problems refreshing listobjects. I'm using this code:
The problem that I'm having is that when it gets to the first ActiveWorkbook.save I get a message box saying "This action will cancel a pending Refresh Data command. Continue?".
Also, the data doesn't refresh until after all the code has finished running. I.e. the routines ImpCAATs and FllwUp ignore any new data that comes from the refreshes.
The code does however all work correctly if I step through it (or step through until after the refreshes and then let the rest run).
I've tried pausing, calculating, selecting cells in the listobject, but can't seem to get it to work. Anyone have any ideas?
Cheers
Code:
Sub Starter1()
'Application.OnTime TimeValue("07:00:00"), "Starter1" 'set the next instance to run tomorrow
Worksheets("Blocked").ListObjects(1).Refresh 'update blocked list
Worksheets("Users_DB").ListObjects(1).Refresh 'update users list
Application.CalculateFull
ActiveWorkbook.Save
Call ImpCAATs
ActiveWorkbook.Save
Application.Wait Time + TimeSerial(0, 45, 0)
Call FllwUp
ActiveWorkbook.Save
End Sub
The problem that I'm having is that when it gets to the first ActiveWorkbook.save I get a message box saying "This action will cancel a pending Refresh Data command. Continue?".
Also, the data doesn't refresh until after all the code has finished running. I.e. the routines ImpCAATs and FllwUp ignore any new data that comes from the refreshes.
The code does however all work correctly if I step through it (or step through until after the refreshes and then let the rest run).
I've tried pausing, calculating, selecting cells in the listobject, but can't seem to get it to work. Anyone have any ideas?
Cheers