A Macro that I wrote (on another machine) is suddenly acting strange on my computer. I wrote the code in the Excel 2010
environment and am trying to step through the code in the same.
Everytime I do so, after a few lines, the rest of the code is immediately executed. If I set a breakpoint it will stop. Sometimes, I can then step through a few more lines before it just auotexecutes again.
What gives? I have found no answers on the web... thus my first post on Stackoverflow.
Thanks for any hints! This is making my life difficult.
UPDATE: I have now gone back to the original programming environment and the stepping through the code there is no problem. So it must be something in my Excel settings! I can't figure out what it could possible be though.
With the subordinate procedures called that way, F8 steps neatly through the main procedure, and each procedure called from within it. Show activity on this post. I have successfully fixed these problems by doing two things: 1.
10.Close the Registry, and re-open Excel, where the F8 key should now work correctly, stepping through the code. Show activity on this post. Since you mentioned that the F8 button works as expected at first, most of my thoughts are cleaned from the table.
You can simulate F8 by clicking each line followed by applying CTRL+F8 ( Run to cursor ). The cursor will act as a breakpoint and it is less bothersome than placing / removing breaks on each and every line.
I cannot explain this, but perhaps I can provide a temporary "workaround", which is the best I can do. You can simulate F8 by clicking each line followed by applying CTRL+F8 ( Run to cursor ). The cursor will act as a breakpoint and it is less bothersome than placing / removing breaks on each and every line.
I found this solution also referenced here. The solution is to make a change to the registry (taken from the source):
The registry change affects RPC Debugging, and you can read more about it on the Microsoft website: Debugging COM Clients and Servers Using RPC Debugging
1.Close Excel
2.Make a backup of the Registry file, then open the Registry -- there are instructions on the Microsoft website
3.Go to the applicable Registry Key:
4.Right-click in the window at the right, and click New
5.Click DWORD (In the screen shot below, the DWORD is for 32-bit Office running on a 64-bit computer)
6.Name the DWORD as DisableOrpcDebugging7
7.Right-click the DWORD, and click Modify
8.Change Value to 1, and click OK.
9.The completed DWORD will appear in the Registry
10.Close the Registry, and re-open Excel, where the F8 key should now work correctly, stepping through the code.
Since you mentioned that the F8 button works as expected at first, most of my thoughts are cleaned from the table.
I cannot explain this, but perhaps I can provide a temporary "workaround", which is the best I can do.
You can simulate F8 by clicking each line followed by applying CTRL+F8 (Run to cursor).
The cursor will act as a breakpoint and it is less bothersome than placing / removing breaks on each and every line.
It is a little bit more handwork, but it goes as fast (at least on a regular desktop).
Hope it can at least reduce some of your frustration when debugging!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With