Excel VB代码停止工作(变量未定义) [英] Excel vb code stopped working (variable not defined)

查看:129
本文介绍了Excel VB代码停止工作(变量未定义)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

(免责声明:我不是程序员,我花时间在serverfault上,我只是一个低级的管理员)

(DISCLAIMER: I'm not a programmer, I spend my time on serverfault, I'm just a lowly admin)

我们有一个Excel电子表格,其中包含在Office 2003中创建的vb代码.

We have an excel spreadsheet with vb code in it that was created in Office 2003.

我们最近使用了Office 2007,电子表格继续正常运行.

We've recently gone to Office 2007, and the spreadsheet continued to work as normal.

但是,在为Office 2007安装Service Pack 2之后,电子表格现在失败,并显示错误消息:未定义变量"

如果我在代码顶部注释掉"Option Explicit"语句,则该代码可以正常工作.

If I comment out the "Option Explicit" statement at the top of the code then the code works fine.

我不明白的是,当错误发生时,它发生在甚至不是变量的东西上(除非我错了?).

What I don't understand is that when the error occurs it is occurring on something that isn't even a variable (unless I'm wrong?).

点击下面的图片查看屏幕截图:

Click the below image to see the screenshot:

http://filedb.experts- exchange.com/incoming/2009/06_w23/t144890/snip.JPG

推荐答案

可能需要重新引用对Package/addin/DataGrid存在的内容的引用.在菜单中检查工具->引用.

The reference to the package/addin/whatever that DataGrid exists in probably needs to be re-referenced. Check Tools -> References in the Menu.

确定,这是我发现的,如果您安装Microsoft安全通报960715,则该控件将被杀死.有些修复程序可能对您不起作用.该博客上有一篇不错的文章:

OK, here's what I found, it appears that if you install Microsoft Security Advisory 960715, that that control is killed. There are fixes which may or may not work for you. A good article is on this blog:

VSOD博客

这篇关于Excel VB代码停止工作(变量未定义)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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