无需在 MS Excel 中打开即可读取 Excel 文件的 VBA 宏(或 vbaProject.bin) [英] Read VBA macros (or vbaProject.bin) of an Excel file without opening it in MS Excel

查看:36
本文介绍了无需在 MS Excel 中打开即可读取 Excel 文件的 VBA 宏(或 vbaProject.bin)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想分析 Excel 文件,尤其是那些包含 VBA 程序的文件.因为我打算对大量 Excel 文件逐个运行此分析,所以我不想在 Microsoft Excel 中打开这些文件来分析它们.

I would like to analyze Excel files, especially those which contain VBA programs inside. because I plan to run this analysis on lots of Excel files one by one, I don't want to open these files within Microsoft Excel to analyze them.

其中一个困难是查找和解析 Excel 文件的 VBA 宏.我们知道一个Excel文件可以转换成包含大量.xmlvbaProject.bin.zip文件,可以肯定的是VBA 宏位于 vbaProject.bin 中.但是,问题是怎么读?

One difficulty is to find and parse the VBA macros of an Excel file. We know that an Excel file can be converted to .zip file which contains lots of .xml and vbaProject.bin, it is pretty certain that VBA macros are in vbaProject.bin. However, the problem is how to read it?

有人知道是否有任何工具或 API 可以查找和解析 VBA 宏吗?

Does anyone know if there is any tool or API to find and parse the VBA macros?

有没有人知道有没有工具或者API可以读取vbaProject.bin?

Does anyone know if there is any tool or API to read vbaProject.bin?

推荐答案

Microsoft 提供了一个非常大的 PDF,其中记录了如何从 vbaproject.bin 中提取函数:

There is a very large PDF from Microsoft which documents how to extract functions from the vbaproject.bin:

https://interoperability.blob.core.windows.net/files/MS-OVBA/%5bMS-OVBA%5d.pdf [来源]

此资源是最新的 &自 2019 年 6 月 27 日起可用.如果此链接失效(Microsoft 会定期更改其永久链接结构或以其他方式更改其文档/答案存储库的实施方式等),请搜索 MS-OVBA.pdf.

This resource is current & available as of June 27, 2019. The event that this link goes stale (Microsoft periodically changes their permalink structure or otherwise alters how they implement their documentation/answer repositories, etc.), search for MS-OVBA.pdf.

一些附加信息可能会或可能不会补充上述内容:

Some additional information which may or may not be complimentary to the above:

http://www.codeproject.com/Articles/15216/Office-2007-bin-file-format

这篇关于无需在 MS Excel 中打开即可读取 Excel 文件的 VBA 宏(或 vbaProject.bin)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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