VBA Error Handling When Opening Another Macro

  • RonMexico

    Hall of Fame

    Points: 3340

    I have a process in which a macro loops through a list of other macros to run. I'm trying to add error handling in the parent macro so that if one of the other macros being called errors then it won't pop up with an alert and it will also close out and move on to the next macro in the list. Here is what I'm experimenting with but I'm finding it does not control the list of macros being opened.

    Sub Test()
    Application.DisplayAlerts = False

    On Error GoTo ErrorHandling

    Workbooks.Open Filename:= "C:\temp\SubMacro.xlsm"

    Exit Sub
    MsgBox "The following error occurred: " & Err.Description
    End Sub

    Does anyone know if what I'm trying to achieve is possible?

  • Erland Sommarskog


    Points: 23882

    Looks like you are in the entirely wrong forum. This is a forum for SQL Server questions. You need to find a place where they discuss Excel.

    [font="Times New Roman"]Erland Sommarskog, SQL Server MVP, www.sommarskog.se[/font]

  • RonMexico

    Hall of Fame

    Points: 3340

    That's why I posted it under the Programming --> General category. The Programming category has subcategories such as PowerShell and testing methodologies so I did't think it was too far fetched and figured I would give it a shot.

  • pietlinden

    SSC Guru

    Points: 62816

    Try utteraccess.com

    In spite of the name, they discuss all MS Office stuff there.

  • RonMexico

    Hall of Fame

    Points: 3340

    Thanks pietlinden!

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply