Breakpoint not working

JenniferMurphy

Well-known Member
Joined
Jul 23, 2011
Messages
2,691
Office Version
  1. 365
Platform
  1. Windows
I am testing a function in my add-in module. It is getting a value error in the calling cell. I set a breakpoint on the Function statement and a couple of other places in the VBA editor, but they never happen.

I wrote another simple function to test the breakpoint function:

VBA Code:
Function abc(pX)

abc = "Called with " & pX

End Function

Here's the breakpoint:

1720117663134.png


If I call it from a cell =abc(3), it returns "Called with 3", but the breakpoint never happens.

What the heck is going on now?
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
put the BP on: abc = ....
I did that, too. I just did it again. No breaks.

I have put breaks on the function statement thousands of times in the past. They always worked. Is this something new with Win 11?
 
Upvote 0
Not saying it is your issue but you could try the answer Mr Kusleika posted on SO a few years back (not sure if Codecleaner is still available as I couldn't use it as there was never a 64bit version)

1720124738887.png
 
Upvote 0
Solution
Not saying it is your issue but you could try the answer **** Kusleika posted on SO a few years back (not sure if Codecleaner is still available as I couldn't use it as there was never a 64bit version)

Wow. In over 20 years, I have never had a berakpoint fail.

I put a Stop in my code. Did not stop.

I added a debug.assert false. Did not stop.

VBA Code:
Function ConvertToScaledText(pNumber)

Debug.Assert False

Stop

I guess there is something seriously wrong with my add-in module. It looks like Code Cleaner still does not support 64 bit, so I will try in manually.
 
Upvote 0
Just to be clear. This is the procedure:, right?

  1. Export the entire add-in module.
  2. Delete everything in that module, leaving it empty.
  3. Import the exported file back into the module.
  4. Cross your fingers, toes, eyes, heart, bridges, and anything else...
 
Upvote 0
My add-in module has about 20 modules. Is that what the ones listed are called? The problem I was having was with a UDF in the MyUtil module. I exported it, deleted everything, then imported it. Nothing appeared. Freaking out, I tried Ctrl-z and the code reappeared in MyUtil. Then I noticed a new module named MyUtil1. It contains all of the code that was in MyUtil.

So to get it to work right, I don't delete everything in the module I delete the module itself. Is that right? I guess I misunderstood the instructions. The breakpoint is still not working, so I try again deleting the module this time.

1720127454882.png
 
Upvote 0
Ok, I removed MyUtil, then imported the saved .bas file. That UDF still works, but the breakpoint does not and neither does Stop or Debug,assert False.

Could a corrupted module other than MyUtil be causing the problem? You said you had never heard of Stop failing. Is there something more serious here?

I am going to try deleting and restoring all of the modules.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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