LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Old July 12th 19, 06:37 AM posted to microsoft.public.excel.programming
external usenet poster
First recorded activity by ExcelBanter: Jan 2009
Posts: 11
Default API Call Caching?

I have developed a simple PHP CRUD Rest API with Excel interfacing as the front end UI.

When spreadsheet loads opens a form which fires off a GET request using the following method:

Sub getData()

Dim ws As Worksheet
Dim jsonText As String, sUrl As String, response As String
Dim xmlHttp As New MSXML2.XMLHTTP60

Dim JSON As Dictionary

Dim i As Long
Dim Item As Object
Dim comp As Dictionary

Set var = Nothing
Set JSON = Nothing
response = ""

sUrl = "http://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

With xmlHttp
.Open "GET", sUrl, False
End With

response = xmlHttp.ResponseText
Debug.Print response
Set JSON = JsonConverter.ParseJson(response)
ReDim var(JSON("records").Count, 5)
i = 0
For Each comp In JSON("records")
var(i, 0) = comp("CompId")
var(i, 1) = comp("CompName")
var(i, 2) = comp("Address1")
var(i, 3) = comp("Address2")
var(i, 4) = comp("Address3")
var(i, 5) = comp("PostCode")

i = i + 1

Set xmlHttp = Nothing

Debug.Print "finished"
End Sub

Which works great gets the data and displays on form.

Via another routine i can add a new company record. and verify that i can see it on the web server.

However, when i next fire the GET method. It does not return the new record. I have placed some debugging on the Server and it only registers the initial call. any subsequent calls arent being logged.

If i close Excel down and reopen i get the new record. I destroy all the variables after use. I am not sure where to go next? ANy pointers greatfullly received.

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
caching in excel murali velaga Excel Programming 5 May 12th 09 12:11 PM
Caching a high and low value [email protected] Excel Programming 4 December 6th 08 09:59 PM
Caching? Dean[_8_] Excel Programming 21 November 8th 06 09:38 PM
images caching James Madden Excel Programming 0 April 19th 06 12:09 AM
EXCEL CACHING ... affordsol Excel Programming 0 February 23rd 06 05:11 PM

All times are GMT +1. The time now is 08:10 PM.

Powered by vBulletin® Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.
Copyright 2004-2021 ExcelBanter.
The comments are property of their posters.

About Us

"It's about Microsoft Excel"


Copyright © 2017