PDA

View Full Version : Save Breakpoints



KevinPhilips
07-22-2013, 08:44 AM
Hi all,

how can I set and save a breakpoint in VBA?

I read that you can put the statement "Stop". But for some reason it does not work in my automated Macro:

Private Sub Workbook_Open()

Dim versionDB As String

Where would I put the "Stop"? Any other suggestions?

Thank you guys so much for your help!

Kevin

Kenneth Hobs
07-22-2013, 09:32 AM
Works for me. It is a Debug tool meant to stop autoexecution at that point. You can then debug or continue debug one line at a time with F8.

Though autoexecute, it is easily tested by just playing it from the VBE.

e.g.
Private Sub Workbook_Open()
Dim i As Integer

For i = 1 To 10
If i = 5 Then Stop
MsgBox i & "/10"
Next i
End Sub