• How to exit VBA loop

    Author
    Topic
    #497504

    I have developed, in conjunction with “Zeddy”, a project that winds up as a shared workbook. It has just developed a problem where by it goes into an endless VBA loop checling for I don’t knnow what!
    Is there any way I can stop the loop to turn the sharing off and access the file?

    Viewing 8 reply threads
    Author
    Replies
    • #1477319

      Without an idea where it’s looping it’s a bit hard to suggest.
      Are you able to make it loop or does it just do it when it feels like it?

      cheers, Paul

    • #1477320

      If the code is still running you can force a break by pressing Ctrl-Break on the keyboard.

      Failing that, you can kill off the application or process using the Task Manager

      • #1477344

        Andrew
        Yes I can kill it off using Task Manager but that does not give me access to the workbook to stop the Sharing

    • #1477323

      You can step through the code in the VBA IDE (it used to be Shift F10 to open the debugger) then press F5 to step through.
      Alternatively, put some messagebox followed by exit command to make the code break at some point, then let it run on it’s own.

      cheers, Paul

    • #1477343

      Paul
      I cannot get access to the code becsue it is a shared workbook and effectively locked

    • #1477365

      Phil

      Is your question “How do I stop a macro from running automatically on opening a Workbook?” or “How do I stop a workbook from being shared?”

      What is Zeddy? Is that relevant to why the workbook is shared?

      • #1477799

        Andrew
        Yes, how do I stop the macrto from running automatically on opening. If I can stop it running I can stop the sharing.

        “Zeddy”, Richard, is the forum member who assisted me when I designed the training record spreadsheet

    • #1477533

      You can change the security settings in the spreadsheet program to prevent macros running.

      cheers, Paul

    • #1478114

      Hold the Shift key while opening the workbook.

      • #1478131

        Thanks Rory
        Problem was a conflict with a misspelled staff name between the staff list and the code.

        Fixed however, there appears to be a conflict between Office 2010 and Office 2013. mmmm! maybe because I converted it the 2013 format

        • #1478261

          Fixed however, there appears to be a conflict between Office 2010 and Office 2013. mmmm! maybe because I converted it the 2013 format

          You’ll have to be more specific, please.

    • #1478351

      Rory
      Thanks to your suggestion I managed to open the file and find the offending code and fix, but I did notice that the file when opened in 2013 was in “compatibility mode”

    • #1478615

      “Every Problem you deal with today Is, the direct result of a solution to, a previous problem !”
      Werner Earhardt

    Viewing 8 reply threads
    Reply To: How to exit VBA loop

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: