Link to home
Start Free TrialLog in
Avatar of Rayne
RayneFlag for United States of America

asked on

Remeber / Save the last breakpoints - Excel VBA

Hello to All VBA Gurus and my beloved EE Forum,

After doing a lot of VBA coding and then spending hours on testing the codes – I came to this question – when I am debugging, I am setting breakpoints in different functions. Now if I close the workbook – is there a way to save the break POINTS or remember them so that when I reopen the workbook – the VBA editor remember where the break points was set last time – that way I am not re-applying the same breakpoints again. I know this sound strange – but if someone can guide me and let me know if there is workaround or solution for this need? Anything will greatly help.

Thank you
SOLUTION
Avatar of Anthony Berenguel
Anthony Berenguel
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
i just realized you didn't need all the irrelevant code.

here's the important bit that is relevant to your quesiton
 'notice the line below is commented out. This is what I would have in the live version of an application so that the msgbox doesn't pop up for the users. 
    'But when I'm developing and debugging I'll use find and replace to remove the 'dbg from the project. 
    'This way the msgbox's display and when you press Ctrl + pause (or break depending on your keyboard) you will be brought to the VBE. 
    'Putting the 'dbg prefix on the msgbox's aren't as easy to accomplish but you do a find for "BREAKPOINT" and for each instance you have to manually add the prefix. 

    'dbgMsgBox "Ctrl + Pause/Break to debug", vbInformation, "BREAKPOINT!"

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Saqib Husain
Saqib Husain
Flag of Pakistan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
@ssagibh - BRILLIANT!!! I am definitely going to use that going forward!
No, there's no way to save the breakpoints. I wrote this article about debugging, and while it is aimed at VB6 most of it is relevant to VBA.
Avatar of Rayne

ASKER

Hello Everyone,

Aebea – your idea  - definitely I add to my list Thank you ¿

Ssaqibh – as always I have reserved my favorite phrase for you “Perfection to the  ultimate”
But now I have changed that phrase to “Perfection to the EXTREME ultimate”

Martin - sure I keep that in mind.

I am definitely sure that many VBA programmers will find this question and solutions to be very very useful.
Slow down! Slow down! These are just routine VB statements. Since you are new you find this brilliant. Just carry on the way you are and very soon you would wonder how can one program without such a simple thing!!!

Thanks for the points.
Avatar of Rayne

ASKER

You are very welcome Ssaqibh :)
Avatar of Rayne

ASKER

Can't thank you enough Ssaqibh - this is working SWEET!!