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.