Tag: excel vba mac

Dir()函数不适用于Mac Excel 2011 VBA

嗨,我想列出Excel工作簿所在的子目录中的所有文件。出于某种原因,代码不能超出Dir函数执行。 任何人都可以请指教? 谢谢! Sub ListFiles() ActiveSheet.Name = "temp" Dim MyDir As String 'Declare the variables Dim strPath As String Dim strFile As String Dim r As Long MyDir = ActiveWorkbook.Path 'current path where workbook is strPath = MyDir & ":Current:" 'files within "Current" folder subdir, I am using Mac Excel 2011 'Insert the headers in […]

Office 2011 for Mac中的VBA Shellfunction

我正尝试从Mac版Word 2011中的VBAmacros启动一个shell脚本,该脚本将在terminal窗口中运行。 我已经尝试使用Shell函数和MacScript函数,但是VBA解释器似乎无法在任何情况下find脚本。 根据VBA参考文档,以下应该工作: RetVal = Shell("Macintosh HD:Applications:Calculator.app", vbNormalFocus) 这会产生运行时错误53'未find文件'。 有什么build议么?