问题
Is there a conditional that I can use to differentiate if my Macro is running on Office 2016 for Mac or Office for Mac 2011
回答1:
In Office 2016 for Mac, there is a new conditional called MAC_OFFICE_VERSION to test which VB version the user is running. The following example shows how it to use it in your code:
Sub VersionConditionals()
#If MAC_OFFICE_VERSION >= 15 Then
Debug.Print "We are running on Mac 15+"
#Else
Debug.Print "We are not running on Mac 15+"
#End If
#If Mac Then
Debug.Print "We are running on a Mac"
#Else
Debug.Print "We are not running on a Mac"
#End If
End Sub
Note: The "#If Mac" conditional remains unchanged from Office for Mac 2011.
来源:https://stackoverflow.com/questions/30990025/how-can-i-determine-if-my-vb-code-is-running-on-office-2016-for-mac