Cannot step through entire macro - works to a point then runs rest of commands

KGee

Well-known Member
Joined
Nov 26, 2008
Messages
537
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
I'm getting a macro error in a file that hasn't been modified in nearly a year. I suspect it has something to do with the machine I'm using now which crashes Excel when I select yes to debug the code. So I am trying to manually step through the code using F8 to determine which line it doesn't like but I get to a certain point and then it tries to run the rest of the macro. Any reason why it would do something like this? In the meantime I'm going to put in a number of breakpoints to see if that helps me find the problem. Thanks
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
which ever line you think the error is, before that, insert a line
on error goto 0
and debug again. remove the line when you have found out the error.
 
Upvote 0
Solution
Thanks jsb I was able to figure out which line of code is at fault. I am adding a new workbook and based on the link Peter provided it seems that might be one of the triggers for this step-through behavior. So the line causing the problem is doing an XLPasteFormats. I will open a separate thread for that issue but the strange thing is I have the exact same code in multiple files and it is only crashing in this file.
 
Upvote 0
I am adding a new workbook and based on the link Peter provided it seems that might be one of the triggers for this step-through behavior.
That is exactly the sort of thing that used to be the problem for me stepping through the code. I made the registry change and haven't experienced the run-through behaviour ever again. ?
 
Upvote 0
That is exactly the sort of thing that used to be the problem for me stepping through the code. I made the registry change and haven't experienced the run-through behaviour ever again. ?
The Reg is locked down on our machines but I already have a pending request to get admin rights so I'll be able to change it soon...hopefully. Thanks
 
Upvote 0

Forum statistics

Threads
1,214,585
Messages
6,120,388
Members
448,957
Latest member
Hat4Life

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top