Think the answer is using the full path using slashes instead of colons. For example:
Private Declare PtrSafe Function popen64 Lib "/usr/lib/libc.dylib" Alias "popen" (ByVal command As String, ByVal mode As String) As LongPtr
Apparently they got along fine with just "libc.dylib" before. Perhaps they changed the way the sandboxing works (or other) and now everything external needs the slashed path.
Hi Mark, I'm new to VBA and I have this module in my file and I get the same error as the OP.
Can you advise if I need to replace popen with popen64 on both the IF and else first line?
And if I need to add the full path to all occurrences of libc.dylib
#If Mac Then
#If VBA7 Then
Private Declare PtrSafe Function popen Lib "libc.dylib" (ByVal command As String, ByVal mode As String) As LongPtr
Private Declare PtrSafe Function pclose Lib "libc.dylib" (ByVal file As LongPtr) As Long
Private Declare PtrSafe Function fread Lib "libc.dylib" (ByVal outStr As String, ByVal size As LongPtr, ByVal items As LongPtr, ByVal stream As LongPtr) As Long
Private Declare PtrSafe Function feof Lib "libc.dylib" (ByVal file As LongPtr) As LongPtr
#Else
Private Declare Function popen Lib "libc.dylib" (ByVal command As String, ByVal mode As String) As Long
Private Declare Function pclose Lib "libc.dylib" (ByVal file As Long) As Long
Private Declare Function fread Lib "libc.dylib" (ByVal outStr As String, ByVal size As Long, ByVal items As Long, ByVal stream As Long) As Long
Private Declare Function feof Lib "libc.dylib" (ByVal file As Long) As Long
#End If
#End If