+ Reply to Thread
Results 1 to 8 of 8

Run-time error stops all workbooks

  1. #1
    Registered User
    Join Date
    05-24-2013
    Location
    Hampshire
    MS-Off Ver
    Office 2013
    Posts
    49

    Run-time error stops all workbooks

    Hey Guys

    Got a workbook which sometimes throws up a run time error if a user fails to properly copy data prior to pressing OK on a popup box which runs a macro. The error is obvious and is not the problem. The matter is that when it happens, other people who use the workbook, press END on the 'Run-time Error' dialog box. This also stops the vba within any open workbook. Ie I have another workbook open at the same time which automatically saves prior to closing when pressing the closing X. But that stops working as soon as someone has pressed END on the run time error dialog box on another open workbook.

    Any ideas how to prevent this?

    Cheers

    Ash

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,645

    Re: Run-time error stops all workbooks

    Ash

    Are you disabling events at any point?
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    05-24-2013
    Location
    Hampshire
    MS-Off Ver
    Office 2013
    Posts
    49

    Re: Run-time error stops all workbooks

    This is a possibility, the second workbook I use is not one created by me and cannot access the vba coding of it. I use Office 2010 at the place I use these workbooks, so they open in the same "Excel Window" and not in seperate applications. Would this perhaps be a cause aswell?

    Cheers

    Ash

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,645

    Re: Run-time error stops all workbooks

    Ash

    Well it sounds like the macros the aren't running are event code and if events were disabled that would stop them from running.

    Can you access the code that causes the error?

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,489

    Re: Run-time error stops all workbooks

    Agree with Norie. Sounds as though you have Application.EnableEvents = False at some point. Seems that you haven't got any, or adequate, error handling. So, when the error is presented, the code does not complete and, consequently, you do not switch on Event handling. That then means that workbook open and close events won't be actioned ... anywhere. Nor will change or selection event handlers.

    It will require a review of your code and the error handling to be enhanced.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  6. #6
    Registered User
    Join Date
    05-24-2013
    Location
    Hampshire
    MS-Off Ver
    Office 2013
    Posts
    49

    Re: Run-time error stops all workbooks

    Thats great, I will try and see if the creator of the spreadsheet will allow me access to check it over!

    Thanks for your help guys,

    Ash

  7. #7
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,489

    Re: Run-time error stops all workbooks

    In the meantime, you could create a separate macro enabled workbook that simply contains one sheet with one button that runs the "recovery" code.

    Please Login or Register  to view this content.

    See the attached example workbook.

    Regards, TMS
    Attached Files Attached Files

  8. #8
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,489

    Re: Run-time error stops all workbooks

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save


    You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Getting Run time error '9' from macros in similar workbooks.
    By garysallred in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-02-2014, 08:38 AM
  2. VBA stops after opening a workbooks with macro
    By fabdav in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-21-2012, 06:40 PM
  3. VBA copying shapes between workbooks stops
    By Per Almgren in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-16-2012, 07:52 AM
  4. Macro inexplicably stops after Workbooks.Open
    By thinkfiat in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-03-2007, 09:22 AM
  5. workbooks.open stops the macro
    By leevi in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-09-2007, 12:44 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1