Consulting

Results 1 to 2 of 2

Thread: Save Breakpoints

  1. #1
    VBAX Regular
    Joined
    Jul 2013
    Location
    Hamburg, Germany
    Posts
    10
    Location

    Save Breakpoints

    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
    • Windows 7
    • Office 2010

  2. #2
    VBAX Guru Kenneth Hobs's Avatar
    Joined
    Nov 2005
    Location
    Tecumseh, OK
    Posts
    4,956
    Location
    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.
    [VBA]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[/VBA]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •