Here is my XML file (of course it will be much longer, but this covers it). My goal is to update the XML file when the customer pays. Notice how the file says "August." Come September, the program will not run because the code I enter will not match the September code in the VBA file. Once they pay, I'll update the code in the XML file, then when they run the file, it will work.
I can get it to put the entire XML file in a message box, but I do not know how to search for the agency name then grab the month and code to verify. I think I want the VBA macro to read the XML file, search for Agency Name 2 (for example), when it finds Agency Name 2, grab the date and code. Verify that this date and code match what is expected in the VBA file, then it will allow the rest of the subs to run. Concurrently, I'd like it to put a date, time, and some other stuff back in the XML file as a way to see when they used it last.
I know this isn't great security, since if they can just get past a password they can change the script to avoid this, but it is something. Should I scrap all this and just do it in Visual Basic?
Below is the XML, and below that is my sub to get me a msgbox of what is inside the XML, but I have no idea how to search or write what I am thinking about above. Please give me some advice.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<data-set xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance">
<record>
<Agency>Agency Name 1</Agency>
<Date>August</Date>
<Code>code to give</Code>
</record>
<record>
<Agency>Agency Name 2</Agency>
<Date>August</Date>
<Code>code to give</Code>
</record>
</data-set>
-----------------------------------
Dim xmlhttp As Object
Dim myUrl As String
Set xmlhttp = CreateObject("MSXML2.serverXMLHTTP")
myUrl = "
https://www.mysite.com/myfile.xml"
xmlhttp.Open "Get", myUrl, False
xmlhttp.send
MsgBox (xmlhttp.responsetext)