在本地或观察窗口中查看对象会导致excel崩溃 [英] Viewing an object in Locals or Watch window causes excel to crash

查看:160
本文介绍了在本地或观察窗口中查看对象会导致excel崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Excel中,当我运行一些代码并放置一个断点,我可以看看在本地窗口中的东西的值。在本地窗口中,当我试图展开一个类的对象时,我创建了Excel崩溃与Microsoft Office Excel遇到了问题,需要关闭。我们很抱歉的inconvinience这也发生,如果我试图查看



感谢,



p>

Chris

解决方案

检查,再次检查并重新检查您的类属性你的GET代码。我有同样的错误,扩展一个自定义类对象在调试期间导致Excel崩溃我的猜测是基本上运行那些GET属性当你展开对象在本地窗口,所以他们必须编译。



当然,我不能说这绝对导致OP的错误,而没有看到他们的代码,但对我来说,错误是一个非常简单的一个GET属性包含类型不匹配: / p>

 私有pAccFullArr()As String 

公共属性获取accFullArr()作为变量
accFullArr = pAccFullArr
结束资源

应该是

 私有pAccFullArr()As String 

公共属性获取accFullArr()为STRING()
accFullArr = pAccFullArr
属性


In Excel when I'm running some code and put a breakpoint in I can look at the values of things in the locals window. In the locals window, when I try to expand a object for the class I've created Excel Crashes with "Microsoft Office Excel has encountered a problem and needs to close. We are sorry for the inconvinience. This also happens if I try to view the object in the watch window.

Any ideas? Or anyone had this before?

Thanks,

Chris

解决方案

Check, check again and recheck your class properties, especially your GET code. I had the same error where expanding the a custom class object during debugging caused Excel to crash. My guess is Excel essentially runs those GET properties when you expand the object in the locals window, so they must compile.

Of course I can't say this definitely caused the OP's error without seeing their code, but for me the error was an extremely simple one where a GET property contained a type mismatch:

Private pAccFullArr() As String

Public Property Get accFullArr() As Variant
    accFullArr = pAccFullArr
End Property

should have been

Private pAccFullArr() As String

Public Property Get accFullArr() As STRING()
    accFullArr = pAccFullArr
End Property

这篇关于在本地或观察窗口中查看对象会导致excel崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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