Hi - I am trying to do a Post request to a MySQL database using PowerPoint VBA on Macintosh.
I have tried using the following code, but am receiving issues in accessing the library function.
Private Declare PtrSafe Function system Lib "libc.dylib" (ByVal command As String) As Long
Function getHTTPPost(sUrl As String, sQuery As String) As Long
sCmd = "curl -v -X POST -d '" & sQuery & "' " & sUrl
exitCode = system(sCmd)
End Function
ans = getHTTPPost("http:myserver/AddNew.php?", "name=JoeBloggs&score=20")
However, this code is returning an error: File not found: libc.dylib
I did an online search and found this issue has arisen after some kind of update https://github.com/VBA-tools/VBA-Web/issues/385
The solution indicated is to set the location of the Library file name to "/usr/lib/libc.dylib". Hence I changed the line to:
Private Declare PtrSafe Function system Lib "/usr/lib/libc.dylib" (ByVal command As String) As Long
However, at the moment I continue to get the "file not found" error. I would be very grateful if anyone could tell me what the correct Mac Function Declaration is.
Thank you for any comments!
[Moved from PowerPoint/Mac/Microsoft 365 Apps or Office 365 Business]