Click here to Skip to main content
15,891,607 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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

C++
Excel4(xlfCaller, x, 0)


When it's reached anywhere else, it has never crashed.
When I comment out this code, no crash occurs...
Posted
Updated 16-Jun-11 12:11pm
v2

1 solution

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.
 
Share this answer
 
Comments
T2102 17-Jun-11 8:19am    
Thanks, I spent several hours reviewing and I'm 99% sure this is a memory error in Excel's API and not my code.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900