How to determine if my VB code works in Office 2016 for Mac?

Is there a condition that I can use to differentiate if my Macro works in Office 2016 for Mac or Office for Mac 2011

+3
source share
1 answer

In Office 2016 for Mac, there is a new condition called MAC_OFFICE_VERSION to check the version of VB that the user is launching. The following example shows how to use it in 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” condition remains unchanged from Office for Mac 2011.

+4
source

All Articles