我一直在参与编写 Excel 工作簿以在 Excel 2010 中进行数据分析。但是我最近发现需要使用此文档的某些计算机运行的是 Excel 2003。我意识到保存到 <代码>.xls 格式请参阅此处,但是一直没能找到一个很好的关于VBA代码变化的总结,特别是如何从2010年改变到2003年(而不是其他方式)。
我确实可以使用装有 Excel 2002 的计算机进行测试,但速度非常慢,而且位于大楼另一端的房间内,而且无法访问 Internet。因此,为了避免出现问题时必须来回查找问题,我希望有某种列表或摘要,以便我可以在问题出现之前进行查看以识别问题。
我知道类似的问题有被询问有关 2007-2003 兼容性的问题:
然而,所有答案都只是建议使用虚拟机。我无权在我的工作计算机上安装程序(我主要不是从事编程/IT),我的家用计算机上也没有 Office,也没有许可证。
I have been involved in writing an excel workbook for data analysis in Excel 2010. However I recently found out that some of the machines on which this document needs to be used run Excel 2003. I'm aware of the compatibility issues with saving to .xls
format see here, but haven't been able to find a good summary of changes to the VBA code, specifically how to change from 2010 to 2003 (rather than the other way).
I do have access to a computer with Excel 2002 for testing, but it's very slow, in a room at the opposite end of the building, and has no internet access. So to avoid having to go back and forth to look up issues as they arise, I was hoping for some sort of list or summary that I could look through to identify issues before they arise.
I am aware that a similar question has been asked about 2007-2003 compatibility:
However all the answers simply suggest the use of a virtual machine. I do not have permission to install programs on my work computer (I'm not primarily employed for programming/IT), nor do I have Office on my home computer, or access to a licence.
发布评论
评论(1)
Excel 2007 中的图表对象模型发生了重大变化,然后从宏记录器中省略了。 Excel 2010 恢复了图表的宏记录器,但您会发现录制的代码可能无法在 Excel 2003 上运行。Excel
2003 不支持表格。如果您希望范围对象自动增长,请使用动态命名范围数据量。
Excel 2003 使用命令栏而不是功能区。如果将图标放在功能区上,则需要针对 Excel 2003 以不同的方式处理它。
分析工具库是 Excel 2003 中的可选安装。如果您在代码中使用它的函数,则需要确保它已安装并启用。
如果您在代码中保存文件,请确保使用 FileFormat 参数(仅指定扩展名是不够的)。还要确保对 FileFormat 参数使用整数而不是枚举(例如,使用 51 而不是 xlWorkbookDefault),因为 Excel 2003 无法识别较新的枚举。
The charting object model was substantially changed in Excel 2007, and then omitted from the macro recorder. Excel 2010 restored the macro recorder for charts, but you'll find the recorded code likely won't run on Excel 2003.
Tables aren't supported in Excel 2003. Use dynamic named ranges instead if you want a range object to grow automatically with the amount of data.
Excel 2003 uses command bars rather than the ribbon. If you put icons on the ribbon, you'll need to approach it differently for Excel 2003.
The Analysis ToolPak is an optional install in Excel 2003. If you use functions from it in your code, you'll need to make sure that it is installed and enabled.
If you save files in code, make sure that you use the FileFormat parameter (specifying the extension is not sufficient). Also make sure that you use integers rather than Enums for the FileFormat parameter (e.g. 51 instead of xlWorkbookDefault) because Excel 2003 won't recognize the newer Enums.