Phantom breakpoint?

Gasman

Enthusiastic Amateur
Local time
Today, 22:12
Joined
Sep 21, 2011
Messages
16,923
Hi all,
I have a few lines of code that allow me to import an Excel sheet each day from one of our online systems.

I recently made an amendment to it, and set a breakpoint on a certain line.
Once all was working I removed the breakpoint using the Clear All Breakpoints option as I normally do.

However when running it still stops at that line despite there not being any breakpoint indicator.

I saved the code and workbook after clearing as I normally do, and even tried compiling as well, to no avail.?
The code is in my Personal Workbook.


Has anyone had this happen to them and if so, how do you correct it please.?
 
Last edited:
Try setting the breakpoint on that same line again. Save code Then remove it again and resave.
Or delete the line then save the code.
Comapct and repair then re-instate the line.
 
It has happened to me a long time ago, can't remember why but think it was to do with changing code whilst in break mode.

solution is to decompile/recompile and throw in a compact for good measure.

Alternatively you could try copy and pasting the offending function/sub to notebook. Delete from your module and save, then copy/paste back from notebook to the module
 
Damn, that was quick guys.:D


This is in Excel. I was not aware of a Compact & Repair.?
I'll try the other options now.


Thank you.
 
A slight variation on minty's suggestion is to add a space in your code, save it, remove it and save it again to force a recompile.
 
Thanks all.
From your suggestions I commented out the code and saved, uncommented and saved again.

I put back my backup from todays run and tried again, as this code only runs on certain conditions, one of them happening today, hence my post.


Pleased to say, it did not stop this time. Hopefully that will fix it, but if not, I will try the other options and the code cleaner as well. Thanks for that link Colin.
 
I've done that many a time.:D


I posted it here in this site as I thought as it was a VBA problem, it would happen in Access as well? Seems it does.



my bad, didn't notice the forum section and this threw me off
 
Have had two more occurrences when the code would pass by that breakpoint. Each time it has passed without stopping.


Thank you all.
 

Users who are viewing this thread

Back
Top Bottom