Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/vba/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/macos/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Vba 为PowerPoint(Office 365)Mac开发自定义功能区加载项_Vba_Macos_Powerpoint_Ribbon_Office Addins - Fatal编程技术网

Vba 为PowerPoint(Office 365)Mac开发自定义功能区加载项

Vba 为PowerPoint(Office 365)Mac开发自定义功能区加载项,vba,macos,powerpoint,ribbon,office-addins,Vba,Macos,Powerpoint,Ribbon,Office Addins,我最近从我的Windows work笔记本电脑切换到Mac,在那里我通过PowerPoint加载项安装了一些不错的功能,我想复制这些功能 我所有的宏都在工作,我现在正试图将它们转换成一个可以加载到我的机器上的工作外接程序 现在,在我们开始签署外接程序的棘手部分之前。。我开始非常简单(带有自定义工具栏的pptm文件)。我跟着。但是,当我在Mac上启动演示文稿时(在Windows上它们可以工作),按钮不会触发宏(无论是哪个宏) 以下是customUI.xml文件内容 <customUI xml

我最近从我的Windows work笔记本电脑切换到Mac,在那里我通过PowerPoint加载项安装了一些不错的功能,我想复制这些功能

我所有的宏都在工作,我现在正试图将它们转换成一个可以加载到我的机器上的工作外接程序

现在,在我们开始签署外接程序的棘手部分之前。。我开始非常简单(带有自定义工具栏的pptm文件)。我跟着。但是,当我在Mac上启动演示文稿时(在Windows上它们可以工作),按钮不会触发宏(无论是哪个宏)

以下是customUI.xml文件内容

<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
  <ribbon>
    <tabs>
      <tab id="MyCustomTab" label="My Tab" insertAfterMso="TabHome">

      <group id="customGroup1" label="Group 1">
          <button id="customButton1" label="Caption 1" size="normal" onAction="Macro1" imageMso="Cut" />        
          <button id="customButton2" label="Caption 2" size="normal" onAction="Macro2" imageMso="Bold" />
          <button id="customButton3" label="Caption 3" size="normal" onAction="Macro3" imageMso="Italic" />
        </group>

      </tab>
    </tabs>
  </ribbon>
</customUI>

知道我做错了什么吗?

我可以确认PowerPoint for Mac中XML和VBA回调之间的连接已断开。使用您的示例XML和VBA,我在PowerPoint、Word和Excel启用宏的文件中创建了相同的功能区MOD。这三个系统在Windows中都能正常工作。在Office 2019 for Mac中,只有Word和Excel按预期工作


我已使用程序窗口右上角的Smaily face图标向Microsoft报告了此错误。

我已通过在“安全和隐私”中设置以下首选项(临时)解决了此问题:
*宏安全性>全部启用
*信任对VBA项目对象模型的访问
*允许操作在没有通知的情况下运行程序


如果这有助于

Wild guess,是否还有其他打开的文档可能有
Macro1
,您可以尝试使用唯一的名称吗?与CBTest190831类似,代码是否在mac上编译?你在mac上使用的是什么版本的Office?嗨,我使用的是19081202版本。我尝试了一个独特的名字,但没有成功。谢谢你提到这一点,但除了网络安全专家,我不会向任何人推荐这些设置。奇怪。我去测试了你的设置,ribbon mods运行宏时没有更改任何设置。一定是满月。。。
Option Explicit

'Callback for customButton1 onAction
Sub Macro1(control As IRibbonControl)
    MsgBox "This is macro 1"
End Sub

'Callback for customButton2 onAction
Sub Macro2(control As IRibbonControl)
    MsgBox "This is macro 2"
End Sub

'Callback for customButton3 onAction
Sub Macro3(control As IRibbonControl)
    MsgBox "This is macro 3"
End Sub