Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

macro to refresh webservice functions

Tags:

excel

vba

I have a workbook that has stock data pulled in using the webservice function and I refresh it using Alt-Ctrl-F9. I am trying to create a macro that will do the same function as Alt-Ctrl-F9 but I haven't had any luck. I have tried recording myself pressing those buttons, I've tried

Activeworkbook.RefreshAll  
DoEvents

and I have also tried

ActiveSheet.Calculate

So far, I am having no luck...

like image 846
THAT newbie Avatar asked Mar 16 '23 10:03

THAT newbie


1 Answers

Use

Application.CalculateFull

or

Application.CalculateFullRebuild

The former is the one that is used if you record a macro while hitting CTRL+ALT+F9. The latter is a more thorough version which rebuilds the calculation tree. See CalculateFullRebuild and CalculateFull at MS support for the full story.

like image 71
Byron Wall Avatar answered Mar 23 '23 13:03

Byron Wall