url data is not updated in a vba loop

bloepje

New Member
Joined
Mar 17, 2004
Messages
2
Hello, My problem/challenge is the following: I have a URL that can display the electricity consumption of my home at time "X", this works perfectly, but if I make a loop in VBA for example of 5 minutes, then it changes the value of the data not, (remains the same every 5 minutes) only when I close Excel and then start it again is the data updated
 

Attachments

  • Clip1.jpg
    Clip1.jpg
    18.6 KB · Views: 11

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Which object are you using in order to make your request, XMLHTTP60 or ServerXMLHTTP60 ? Or something else? If you're using XMLHTTP60, try amending your code by adding the following lines after you open your http request, but before you send it...

jsonhttp.setRequestHeader "pragma", "no-cache"
jsonhttp.setRequestHeader "cache-control", "no-cache"

...which basically instructs it to make a server request instead of referring to the cache.

Hope this helps!
 
Upvote 0

Forum statistics

Threads
1,215,472
Messages
6,125,004
Members
449,203
Latest member
Daymo66

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top