In a VBA module in excel 2007, is it possible to call a web service? If so, any code snippets? How would I add the web reference?
Yes You Can! And just in case anyone is wondering: No, this isn't available on reasonably recent Excel versions. :( And just in case anyone is wondering, web service calls are part of VBA, which is available in recent versions, it's part of Excel's development suite, hidden by default.
You can do this by finding the URL of the web service or by finding the API key or username and password needed to access the service. Once you have the URL or key, you can enter it into the WEBSERVICE function in Excel. Excel will then connect to the web service and return the data.
Calls to external APIs can only be made through the Excel application, not through Power Automate under normal circumstances.
Yes You Can!
I worked on a project that did that (see comment). Unfortunately no code samples from that one, but googling revealed these:
How you can integrate data from several Web services using Excel and VBA
STEP BY STEP: Consuming Web Services through VBA (Excel or Word)
VBA: Consume Soap Web Services
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With