andymqld
12-24-2005, 02:06 AM
Dear All,
I have a daily worksheet which contains numerous web tables.
Each day when I create one of these worksheets the number of webtables included vary. The number of tables is a variable, not a constant.
During the course of a day I refresh the data/tables. I then have some code that utilises that data for some sorting and calculation purposes.
As the number of tables vary I use the code "ActiveWorkbook.RefreshAll".
This should work fine, but unfortunately the rest of the code runs and finishes before the web table refreshing is completed, therefore I don't end up receiving the updated data.
I've tried "QueryTable.Refresh BackgroundQuery:=False" and also "Application.EnableEvents = False", but I still can't get it to pause the rest of the code until the refreshing has finished.
Any ideas?
Regards,
andymqld
I have a daily worksheet which contains numerous web tables.
Each day when I create one of these worksheets the number of webtables included vary. The number of tables is a variable, not a constant.
During the course of a day I refresh the data/tables. I then have some code that utilises that data for some sorting and calculation purposes.
As the number of tables vary I use the code "ActiveWorkbook.RefreshAll".
This should work fine, but unfortunately the rest of the code runs and finishes before the web table refreshing is completed, therefore I don't end up receiving the updated data.
I've tried "QueryTable.Refresh BackgroundQuery:=False" and also "Application.EnableEvents = False", but I still can't get it to pause the rest of the code until the refreshing has finished.
Any ideas?
Regards,
andymqld