I need to issue an HTTP Get with a query string to a web service from Excel for Mac 2011. I\'ve seen the answers for using QueryTables (How can I send an HTTP POST request
Another option (update accordingly if your curl is not located in /opt/local/bin/curl):
VBA:
Public Function getUrlContents(url) As String
Dim command As String
command = "do shell script ""/path_to/getUrl.sh " + url + """"
getUrlContents = VBA.MacScript(command)
End Function
/path_to/getUrl.sh:
#!/bin/sh
if [ -z "$1" ]
then
echo "missing url argument"
else
/opt/local/bin/curl "$1"
fi
Note that you will have to ensure that getUrl.sh is executable:
chmod u+x getUrl.sh