Consulting

Results 1 to 5 of 5

Thread: VBA to sequence/ order a list of macros

  1. #1
    VBAX Regular
    Joined
    Jun 2021
    Posts
    17
    Location

    VBA to sequence/ order a list of macros

    Hello - can you VBA to add sequence to the macros created in PowerPoint?
    I got a bunch of macros written in VBA (about 10 different macros) but in order for them to run correctly, they must work in order. If someone opens the Macros there is no way to put orders or sort them, is there? the macros just show up in a list not in any order.

    Basically a bunch of us are going through converting hundreds of PowerPoint decks. I created VBA to convert them and then I exported the VBAs to a file and ask the team to import them to their powerpoint decks. We need to figure out how to put sequence to the macros or create a quick button to click and process through the macros in the order that will work.

    can that be done? what is the most efficient method? hoping someone will share some thoughts. thank you!!

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Why not just create a manager procedure that runs them all in the correct order.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Regular
    Joined
    Jun 2021
    Posts
    17
    Location
    Quote Originally Posted by Bob Phillips View Post
    Why not just create a manager procedure that runs them all in the correct order.
    Hi Bob - not sure if i completely understand this. will you give me an example? thank you!

  4. #4
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,724
    Location
    1. Use Option Private Module on the module(s) that you don't want them to run. Makes them 'invisible' to the user

    2. Create a 'Super Sub' that runs the other modules in the correct order

    Option Explicit
    Option Private Module
    
    
    Sub Hello1()
        MsgBox "Hello1"
    End Sub
    Sub Hello2()
        MsgBox "Hello2"
    End Sub
    Sub Hello3()
        MsgBox "Hello4"
    End Sub
    Sub Hello4()
        MsgBox "Hello4"
    End Sub
    Other module

    Option Explicit
    
    
    Sub RunThemAll()
        Hello1
        Hello2
        Hello3
        Hello4
    End Sub
    Attached Files Attached Files
    ---------------------------------------------------------------------------------------------------------------------

    Paul


    Remember: Tell us WHAT you want to do, not HOW you think you want to do it

    1. Use [CODE] ....[/CODE ] Tags for readability
    [CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
    2. Upload an example
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) / Upload Files / Done
    3. Mark the thread as [Solved] when you have an answer
    Thread Tools (on the top right corner, above the first message)
    4. Read the Forum FAQ, especially the part about cross-posting in other forums
    http://www.vbaexpress.com/forum/faq...._new_faq_item3

  5. #5
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Paul show you how, but you could also make all the sub-procedures as functions, they won't then show up in the list of macros from the Excel UI. Another way would be to put all the sub-procedures in a separate code module, and add Option Private Module at the head of the module, again they won't show.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

Posting Permissions

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