如何确定我的VB代码是否正在Mac的Office 2016上运行? [英] How can I determine if my VB code is running on Office 2016 for Mac?

查看:109
本文介绍了如何确定我的VB代码是否正在Mac的Office 2016上运行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使用一个条件来区分我的宏是否在Mac的Office 2016或Mac 2011的Office上运行

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

推荐答案

在Mac的Office 2016中,有一个名为MAC_OFFICE_VERSION的新条件可以测试用户正在运行的VB版本. 以下示例显示了如何在代码中使用它:

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

注意:Office Mac Mac 2011中的"#If Mac"条件保持不变.

Note: The "#If Mac" conditional remains unchanged from Office for Mac 2011.

这篇关于如何确定我的VB代码是否正在Mac的Office 2016上运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆