Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8276195
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T08:18:27+00:00 2026-06-08T08:18:27+00:00

I have a basic WCF client service in the form below. The first time

  • 0

I have a basic WCF client service in the form below. The first time it is called, it returns the correct data from the remote server. However the data changes frequently. On subsequent calls, it returns the same data that it did on the first call. So, Excel appears to return cached data.
If I run the same WCF procedure from Fiddler or a browser, it seems to always return current/refreshed data (so I think the issue is in Excel, not the server).
How can I force Excel VBA to “refresh” the call instead of getting the data from cache?
Note: this will be distributed to a variety of end users, so I cannot make client config changes.

Public Function CallWCF() As String
   Dim HttpReq As Object
   Set HttpReq = CreateObject("MSXML2.XMLHTTP")
   HttpReq.Open "GET", "http://ws.mydomain.com/Rest.svc/getmydata"
   Call HttpReq.Send
   Do While HttpReq.readyState <> 4
     DoEvents
   Loop
   Dim resp As String
   resp = HttpReq.ResponseText
   CallWCF = resp
   Set HttpReq = Nothing
End Function
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T08:18:28+00:00Added an answer on June 8, 2026 at 8:18 am

    From stackoverflow.com/q/11526810/190829, it appears that adding:
    httpReq.setRequestHeader "If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT"
    solved the issue on my PC (don’t know if it will work on all PCs with different browsers). The other 2:
    HttpReq.setRequestHeader "Cache-Control", "no-cache" and
    HttpReq.setRequestHeader "Pragma", "no-cache"
    did not seem to help.

    I also tried appending the URL with a dummy parameter that changes each request (such as the time or random number) and that also works. However I think it will require changing the server code for all of my operations.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have client application that uses WCF service to insert some data to backend
I have a WCF service application with most basic settings working properly on my
I have a WCF web service, and I want to use Basic authentication. I
I have a WCF service which calls an STA Visual Basic 6.0 COM object.
The problem... I have a WCF Service, I won't waste anyone's time with copy/pasting
I'm trying to create a client for a WCF service that I have hosted
I have created a basic WCF service in IIS. I am aware that this
Here is the scenario. I have a WCF service, when this service is called
I have a WCF web service which allows both Basic HTTP and WS-HTTP clients,
I have a WCF-Service, written in Visual Basic using Visual Studio 2010. I would

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.