使用xlfCaller访问冲突 [英] Access Violation with xlfCaller

查看:74
本文介绍了使用xlfCaller访问冲突的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我评估一个等于另一个定义名称的UDF的定义名称时,尝试获取Excel调用程序时遇到访问冲突.

特别是,当我尝试找到呼叫者时遇到访问冲突.

有什么方法可以判断访问冲突是来自Excel本身还是来自我的代码?

以下代码崩溃

I am getting an access violation when I try to get the Excel caller when I evaluate a defined name that equals a UDF of another defined name.

In particular, I am getting an access violation when I try to find the Caller.

Is there a way I can tell whether the access violation is from Excel itself or from my code?

The following code crashes

Excel4(xlfCaller, x, 0)



当它到达其他任何地方时,它从未崩溃.
当我注释掉这段代码时,不会发生崩溃...



When it''s reached anywhere else, it has never crashed.
When I comment out this code, no crash occurs...

推荐答案

您可以在Visual Studio的帮助下附加到Excel.exe进程.在您的Visual Studio窗口中,打开菜单Debug-> Attach to process ..,然后在列表中选择Excel.exe.然后执行通常的操作.当excel崩溃时,Visual Studio将显示调用堆栈"窗口,您将能够看到代码的确切位置.
You can attach to the Excel.exe process with the help of Visual Studio. In your Visual Studio window, open menu Debug->Attach to process.. and select Excel.exe in the list. Then do what you typically do. When excel crashes, Visual Studio will show you the Call Stack window and you will be able to see the exact place of the code.


这篇关于使用xlfCaller访问冲突的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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