ram*_*ora 4 excel vba mac-office excel-vba-mac
我的宏大量使用MacScript,但在最新的Office for Mac 2016预览版本中似乎都无法使用
不建议使用该MacScript命令,该命令用于支持Office for Mac 2011中的嵌入式Apple脚本。由于沙箱的限制,该MacScript命令无法再调用其他应用程序,例如Finder。因此,我们不鼓励使用此命令。
对于需要更改现有代码以使其不使用的情况MacScript,可以使用AppleScriptTask命令(请参见下文)。
新AppleScriptTask命令执行一个AppleScript脚本。该MacScript命令类似于命令,除了它运行位于沙盒应用程序外部的AppleScript文件。调用AppleScriptTask如下:
Dim myScriptResult as String
?myScriptResult = AppleScriptTask ("MyAppleScriptFile.applescript", "myapplescripthandler", "my parameter string")
Run Code Online (Sandbox Code Playgroud)
哪里:
注意:Mac Word,Excel和PowerPoint的[bundle id]是:
处理程序的示例如下:
on myapplescripthandler(paramString)
#do something with paramString
????return "You told me " & paramString
end myapplescripthandler
Run Code Online (Sandbox Code Playgroud)