Add external data to wordpress website page each time it loads

Associate
Joined
25 Feb 2016
Posts
202
I have a wordpress website built using elementor. We book appointments using an excel spreadsheet. Each time this spreadsheet updates I can use VBA to create a file with available appointments. This could be another spreadsheet, or a text file etc.

I would like my website to use this data and display it in a contact page.

My questions are:

What would be the best format to save the data for it to be imported?
Where do I save it? I can save it in a google drive or FTP it to my site.
How do I get it into my wordpress webpage?

Can anyone help or point me in the right direction? I would like the wordpress page to load this data each time the page loads. A lot of tutorials are about manually importing data once and that's the end.
 
Soldato
Joined
28 Oct 2006
Posts
12,456
Location
Sufferlandria
I'd say the simplest solution for you would be to create some html in your VBA (just a table showing availability or something) and save it as a plain HTML file then FTP it up to your site and use an iframe to display that page on your contact form.

A more elegant (and much more complex) solution would be to use VBA send the updated data directly to the website:
-I don't know VBA but from a quick Google you can use WinHttpRequest to send a request to your site with the updated data.
-create a PHP page on your WordPress site to accept this request and update the database accordingly.
-your contact page then reads this data from the database and displays it
 
Soldato
Joined
3 Jun 2005
Posts
3,061
Location
The South
As @touch says, generating HTML or even JSON and getting Wordpress to use that data would be one of the simplest solutions. Although if you do opt for storing data in a DB (for the site), just make sure you add protection, and not leaving it open to third-parties, on whatever is handling the incoming data.
 
Associate
OP
Joined
25 Feb 2016
Posts
202
Just thought I'd update. Got this up and running. It was easier than I thought. Html created in vba as you close spreadsheet and winscp to folder on site, then iframe. Thanks for pointing me in the right direction.
 
Last edited:
Back
Top Bottom