It is a complex situation - using Excel on Mac and using DECLARE statements.
Also error msgbox hid the declarations you have so it is difficult to say for certain but usually these are used to connect to DLLs which are typically available on Windows. I don't know whether an equivalent option is available on Mac.
On Windows the error can be fixed by following the instructions at https://docs.microsoft.com/en-us/office/vba/language/reference/user-interface-help/declare-statement