如何安装/使用“Scripting.FileSystemObject”在Excel 2010 for MAC? [英] How can I install/use "Scripting.FileSystemObject" in Excel 2010 for MAC?

查看:372
本文介绍了如何安装/使用“Scripting.FileSystemObject”在Excel 2010 for MAC?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用具有VBA版本14.0的 Excel for Mac 2011

I am using Excel for Mac 2011 which has VBA version 14.0.

我正在尝试使用访问文件系统,我知道在Windows上工作:

I am trying to use this code which accesses the file system, which I know works on Windows:

Function qfil_GetDirectory(strDirectoryName As String)

    Dim objFSO As Variant
    Dim objDirectory As Variant

    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set objDirectory = objFSO.GetFolder(strDirectoryName)
    Set qfil_GetDirectory = objDirectory

End Function

然而,当我运行它在Excel for Mac 2011中,它给了我这个错误

However, when I run it in Excel for Mac 2011, it gives me this error:


运行时错误429对象创建
与ActiveX组件不可能

Run-time error 429 Object creation with ActiveX component not possible

要在Windows上修复这个问题,我知道我只需要引用一个特定的 DLL 下的工具。

To fix this on Windows, I know I have to just reference a specific DLL under tools.

但是在Mac上,当我在工具|下参考给我这些:

However on the Mac, when I go under tools | references it only gives me these:

而且没有一个允许我使用 Scripting.FileSystemObject

And none of them allow me to use Scripting.FileSystemObject.

我在Excel 2011 for Mac中必须做什么,以便我可以使用Scripting.FileSystemObject从Excel工作表从硬盘读取文件VBA?

推荐答案

据我所知,这种方法在Mac上无效,因为外部库不存在。

To my knowledge, this approach won't be valid on Mac, as the external library doesnt exist.

不知道Office 11 VBA,但Dir()函数在'03的平台上工作。

Don't know Office 11 VBA, but the Dir() function works accross platforms for '03.

这篇关于如何安装/使用“Scripting.FileSystemObject”在Excel 2010 for MAC?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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