vba 如何在 Excel 2011 for Mac 中解析 XML?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/14211308/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to parse XML in Excel 2011 for Mac?
提问by Jamie Bull
I have some VBA code for accessing various XML-based web APIs from Excel (2007, 2010), and have just run up against a user who is on a Mac running Excel 2011. The code I've developed depends on a reference to MS XML 6.0, which apparently isn't available on the Mac.
我有一些 VBA 代码用于从Excel (2007, 2010)访问各种基于 XML 的 Web API ,并且刚刚遇到了运行Excel 2011的 Mac 上的用户。我开发的代码依赖于对 MS XML 6.0 的引用,这显然在 Mac 上不可用。
This seems to be a problemothers have run up against with no resolution.
- Does anyone know of a replacement for MS XML 6.0 on the Mac, or a workaround?
- Is it possible for the user to just download and install the relevant .dll?
- 有谁知道 Mac 上 MS XML 6.0 的替代品或解决方法?
- 用户是否可以只下载并安装相关的 .dll?
采纳答案by James Snell
One cross-platform solution is to use a QueryTable like this one, that would certainly be better than rolling your own xml handler for the mac.
一种跨平台解决方案是使用像这样的 QueryTable ,这肯定比为 mac 滚动您自己的 xml 处理程序更好。
回答by nadyne
I see that your first question has been answered. For your second question: no, the Mac user cannot just install the appropriate .dll. DLL is a Dynamic Link Library, which provides Windows applications with specific functionality. Neither OS X nor Excel:Mac can do anything with a DLL file, just as OS X can't do anything with a Windows executable .exe file. If rewriting the code to make it work cross-platform isn't in the cards, you could ask your Mac user to run Excel 2010 via a virtualization application or by dual-booting into Windows.
我看到您的第一个问题已得到解答。对于您的第二个问题:不,Mac 用户不能只安装适当的 .dll。DLL 是一个动态链接库,它为 Windows 应用程序提供特定的功能。OS X 和 Excel:Mac 都不能对 DLL 文件做任何事情,就像 OS X 不能对 Windows 可执行的 .exe 文件做任何事情一样。如果重写代码以使其跨平台工作不在考虑之列,您可以要求您的 Mac 用户通过虚拟化应用程序或通过双引导进入 Windows 来运行 Excel 2010。