Excel 2007 卷影复制?
我的问题是关于 Excel 加载项和 VBA 代码。
情况是这样的:
有2个Excel文件;一种是普通的 Excel 工作表,一种是带有 VBA 代码的 .xla 加载项,该代码存储在网络驱动器上。
在普通的 Excel 工作表中是对 .xla 文件的引用,以便工作表可以使用 .xla 文件中的宏。到目前为止,这工作正常,但有时似乎存在错误:看起来工作表使用了 .xla 文件的某种“影子副本”。 当我在 VBA 编辑器中更改代码或设置断点时,会出现该错误,运行宏时两者都会被忽略。感觉就像有 .xla 文件的旧副本,它是不可见的,并且以某种方式存储在普通 Excel 文件中,因此运行的代码不是我在编辑器中看到的宏。
我认为自从我安装了MS Office 2007以来就出现了这个问题。
我希望有人可以帮助我。
My question is about Excel add-ins and VBA code.
This is the situation:
There are 2 Excel files; one is just a normal Excel sheet, one is a .xla add-in with VBA code which is stored on a network drive.
In the normal Excel sheet is a reference to the .xla file so that the sheet can use the macros from the .xla file. This works fine so far, but sometimes there seems to be a bug: It looks likes the sheet uses some kind of "shadow copy" of the .xla file.
The bug occurs when I change code in the VBA editor or I set a breakpoint, both are ignored when running the macro. It feels like there is a old copy of the .xla file, which is invisible and which is somehow stored in the normal Excel file, so the code running is not the macro I see in the editor.
I think this problem has occurred since I installed MS Office 2007.
I hope someone can help me.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果 Excel 在本地存储您的加载项版本,我不会感到惊讶。当对您的 xla 进行更改时,我一定会重新添加您的加载项以确保安装最新版本。
编辑:
您可以尝试执行以下操作:
这将确保在打开 Excel 工作表时从您的网络位置加载最新的插件。
I wouldn't be surprised if Excel is storing a version of your add-in locally. When making a change to your xla, I would be sure to re-add your add-in to ensure the latest version is installed.
EDIT:
You could try doing something like this:
That would make sure the latest addin is loaded from your network location when they open the excel sheet.
我没有引用文件,而是通过代码加载插件。我的用途是将我的插件存储在我的 Dropbox 文件夹中,但网络也可以同样工作。
您需要将其添加为受信任位置,但让我将我正在处理的任何插件放入该文件夹中并让它们自动加载。
遍历我修改过的文件夹中的文件的代码:
http://www.ozgrid.com/VBA/2007-filesearch-alternative.htm
Rather than referencing the file I load the addin's via code. My use is to store my addins in my Dropbox folder but a network would work the same.
You need to add it as a trusted location but lets me put any addin's I'm working on in the folder and having them auto load.
The code to iterate through files in a folder I modified from:
http://www.ozgrid.com/VBA/2007-filesearch-alternative.htm