VBA需要重新编译的问题? [英] Issues with VBA needing to be recompiled?

查看:193
本文介绍了VBA需要重新编译的问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个.xlsm文件,当我打开它并点击启用内容时 - Excel会立即崩溃。如果我将相同的文件打开,但不是启用内容,而是打开VBA并重新编译代码,然后保存并关闭。如果我再次打开文件并启用
内容 - 一切都很好。我什么也没做,只是重新编译代码并保存工作簿。


我想知道非工作版本和工作版本之间的区别。所以我恢复了以前版本的文件并将其保存为副本。我使用Excel 2013电子表格比较工具来比较该文件的工作和非工作
版本。只有一件事是不同的。 (


>>他们保存文件时会出现问题,然后我尝试打开它吗?


根据当前的信息,我们无法确定Excel崩溃的根本原因。将重点提供用于重现此问题的示例宏启用电子表格。


最好的问候,


Edward


I have a .xlsm file that when I open it and hit enable content - Excel crashes immediately. If I take that same file open it, but instead of enabling content, open up VBA and recompile the code then save and close. If I open the file again and enable the content - everything is fine. I did nothing but recompile the code and save the workbook.

I wanted to know what was the difference was between the non-working version and the working version. So I restored the previous version of the file and saved it as a copy. I used the Excel 2013 spreadsheet compare tool, to compare the working and non-working versions of that file. There was only one thing that was different. (Here is a link to the results exported as a Excel file, incase you can't see the picture.)

Looking around online, it looks like this is the VBA Header. I'm not a huge expert on VBA code so I don't really know what that mumbo jumbo is saying that changed.

How can I go about finding/troubleshooting this issue were I need to recompile to use the workbook? Why did the VBA code need to be recompiled for the workbook to function again? What really changed?

I'm using Office 2013 64-bit, and update regularly. Other people use this file with Office 2010 64-bit and Office 2010 32-bit. Could there be issues when they save the file, then I try and open it? We are all using Win 7 x64 and Win 8.1 x64. Any help would be greatly appreciated.

解决方案

Hi dvsh88,

>> I did nothing but recompile the code and save the workbook.

What do you mean by "recompile the code". I was confused by the concept recompile, VBA is not a compiling language, and I do not think we can really recompile the VBA code.

>> I'm using Office 2013 64-bit, and update regularly. Other people use this file with Office 2010 64-bit and Office 2010 32-bit.

As far as I know, in previous versions of VBA, there was no specific pointer data type so the Long data type was used. And because the Long data type is always 32-bits, this breaks when used on a system with 64-bit memory because the upper 32-bits may be truncated or may overwrite other memory addresses. Either of these situations can result in unpredictable behavior or system crashes. More information you could refer the link below:

# Compatibility Between the 32-bit and 64-bit Versions of Office 2010

https://msdn.microsoft.com/en-us/library/office/ee691831(v=office.14).aspx

>> Could there be issues when they save the file, then I try and open it?

According to the currently information, we are not able to identify the root cause of Excel crash. A sample macro-enabled spreadsheet to reproduce this issue will be appreciated.

Best Regards,

Edward


这篇关于VBA需要重新编译的问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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