Excel 2003 标准版中的 XML 导入

发布于 2024-08-10 19:22:05 字数 264 浏览 2 评论 0原文

我们构建了一个 Excel 2003 模板,要求用户选择一个 XML 文件,然后将该文件导入到 XML 映射中并用于填充工作表。

不幸的是,事实证明用户使用的是 Excel 标准版,它不包括 XML 导入功能 - 即 Workbook.XmlImport 函数。

用户可以通过“文件”->“打开 XML 文件”。打开等,但这会将其作为新工作簿打开。

有谁知道有办法解决这个问题吗?当用户使用Excel 2003标准版时,如何获取XML数据来填充XML Map?

We have built an Excel 2003 template that asks the user to select an XML file which is then imported into an XML Map and used to populate a worksheet.

Unfortunately it turns out that the users have Excel Standard Edition, which does not include the XML import functionality - namely the Workbook.XmlImport function.

Users are able to open the XML file via File -> Open etc, however this opens it up as a new workbook.

Does anyone know of a way to get around this? How can we get the XML data to populate the XML Map when the users have Excel 2003 Standard Edition?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

吹梦到西洲 2024-08-17 19:22:05

快速解决方法:

  1. 让他们选择要打开的文件,
  2. 使用 vba 打开该文件到新工作簿中,
  3. 复制新工作表的内容(或将其全部读入 vba 记录集进行解析)
  4. 将其粘贴回活动工作表中(可能在您之后)已在 VBA 中对其进行了操作)
  5. 关闭 xml 工作表,而不保存任何更改。

这可以解决这个问题,但不会那么灵活。取决于你需要用它做什么。

有什么帮助吗?

Quick workaround:

  1. Let them select the file to open
  2. open that file into a new workbook using vba,
  3. copy the contents of the new worksheet (or read it all in to vba recordsets to parse)
  4. paste it back into your active worksheet (maybe after you've done stuff to it in VBA)
  5. close the xml worksheet, not saving any changes.

That would get around it, but it won't be quite as flexible. Depends how much you need to do with it.

Any help?

橪书 2024-08-17 19:22:05

最好的当然可能是购买 2003 Professional 的二手版本。你可以花大约 50 美元买一个。如果您有大量用户,这显然无法扩展。如果您有四个用户,则花费 200 美元即可解决您的问题。

如果您正处于升级的边缘,您可以加快该过程并确保 2007 版本具有 XML 支持。我想说 2007 年都有 XML,但在你相信我的话之前一定要调查一下它。

选项 3 涉及大量时间和代码。您可以编写 VBA 来导入和刷新 XML(或 CSV 或其他内容)。显然,您必须权衡编码成本才能找到并购买足够的二手许可证。

The best course may be to buy a used version of 2003 Professional. You can get one for about $50. If you have a ton of users, this obviously doesn't scale. If you have four users, this would be a $200 fix to your problem.

If you're on the verge of upgrading, you might accelerate that process and make sure the 2007 flavor has XML support. I want to say that all of 2007 has XML, but definitely investigate it before you take my word.

Option 3 involves a lot of time and code. You can write VBA to import and refresh XML (or CSV or something else). Obviously you'd have to weigh the cost of coding to finding and buying enough used licenses.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文