+ Reply to Thread
Results 1 to 17 of 17

List of last running macros

  1. #1
    Forum Contributor HerryMarkowitz's Avatar
    Join Date
    09-10-2012
    Location
    Europe
    MS-Off Ver
    Office 2021 - Win10
    Posts
    1,007

    Lightbulb List of last running macros

    Hi,
    I have 50 macros in the Module1.
    Every night I run these 50 macros one by one.
    But, I have to be careful when running these 50 macros without skipping.
    So, I need to see a list which macros I runned before.

    So far, I found this way to follow which macros I runned before.
    Please Login or Register  to view this content.
    But, I believe that better way exist.
    Thanks in advance.

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: List of last running macros

    why dont you get a macro to run the macros in sequence?

    Please Login or Register  to view this content.

  3. #3
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: List of last running macros

    Each macro needs to set the error flag if it has an error

  4. #4
    Forum Contributor HerryMarkowitz's Avatar
    Join Date
    09-10-2012
    Location
    Europe
    MS-Off Ver
    Office 2021 - Win10
    Posts
    1,007

    Re: List of last running macros

    Mehmetcik kardeşim,
    Anlayamadım ben biraz açıklar mısın ?

  5. #5
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: List of last running macros

    lets look at your first Macro.

    lets say that it is

    Please Login or Register  to view this content.
    This is a simple macro that will set the public variable to 0 and change it to 1 if there is an error

    so going back to your scheduling macro

    Please Login or Register  to view this content.

    Ok the following is my ""Error Control" subroutine
    it simply looks at the error flag and displays a message.

    I havn't used the macro number for anything because I realised that the error flag could tell me the macro number.
    However if our macros have names and not numbers then
    Please Login or Register  to view this content.
    would give you access to the calling macro name for your error message.

    Please Login or Register  to view this content.

  6. #6
    Forum Contributor HerryMarkowitz's Avatar
    Join Date
    09-10-2012
    Location
    Europe
    MS-Off Ver
    Office 2021 - Win10
    Posts
    1,007

    Re: List of last running macros

    Sorry, your explanations are very complicated. I dont understand what you mean...

  7. #7
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: List of last running macros

    Ahh

    ok.

    you can use a master macro to call each of your macros as sub macros.

    The problem is that if there is an error the rest of the macros will keep running unless to take action to stop that.

    Lets start slowly.

    if you create a scheduling macro, you can get it to call macros one to 50 in order.

    try building that.

    Something like

    Please Login or Register  to view this content.
    The above code will cause macros 1 to 4 to run in order

  8. #8
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: List of last running macros

    you could add to the end of each macro
    before end sub
    Please Login or Register  to view this content.
    if the text file doesn't exist it will be created.. there are all sorts of things you could do with that
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  9. #9
    Forum Contributor HerryMarkowitz's Avatar
    Join Date
    09-10-2012
    Location
    Europe
    MS-Off Ver
    Office 2021 - Win10
    Posts
    1,007

    Re: List of last running macros

    Dear mehmetcik,
    I run these 50 macros one by one because I need to see what happened after every macro run.
    That means I dont want to run all of macros once.
    Similar thing could be done connecting every macros with "call" code.

    So, your advice is not suitable with my question

  10. #10
    Forum Contributor HerryMarkowitz's Avatar
    Join Date
    09-10-2012
    Location
    Europe
    MS-Off Ver
    Office 2021 - Win10
    Posts
    1,007

    Re: List of last running macros

    Dear martindwilson,
    Your advice is to create a text file to follow every macros.
    It is similar thing to create an userform to follow every macros.
    But thanks for the answer.

  11. #11
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: List of last running macros

    You can pause after each macro by displaying a modeless userform that simply says click to run next macro.

  12. #12
    Forum Contributor HerryMarkowitz's Avatar
    Join Date
    09-10-2012
    Location
    Europe
    MS-Off Ver
    Office 2021 - Win10
    Posts
    1,007

    Re: List of last running macros

    Dear Mehmetçik,
    How can I pause each macros in the exact time ?

  13. #13
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: List of last running macros

    Ok

    I have created a user form for you.

    All you need to do is to enter the macro names into the array and run the macro.

    It will run the macros in sequence and stop between each macro.

    The user form is modeless so you can push it around and check your spreadsheet.

    If you are happy with the spread sheet you can click to run the next spreadsheet.

    My sample runs three simple macros in sequence.

    Enjoy.

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by mehmetcik; 11-09-2013 at 01:03 PM.

  14. #14
    Forum Contributor HerryMarkowitz's Avatar
    Join Date
    09-10-2012
    Location
    Europe
    MS-Off Ver
    Office 2021 - Win10
    Posts
    1,007

    Re: List of last running macros

    Hi mehmetcik,
    Thanks for the file.
    But your macro has an error.
    You can find error picture enclosed.
    Attached Images Attached Images

  15. #15
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: List of last running macros

    sorry I sent you the wrong version.

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by mehmetcik; 11-10-2013 at 04:41 PM.

  16. #16
    Forum Contributor HerryMarkowitz's Avatar
    Join Date
    09-10-2012
    Location
    Europe
    MS-Off Ver
    Office 2021 - Win10
    Posts
    1,007

    Re: List of last running macros

    Hi mehmetcik,
    Now this works great. Thank you...

    Lets go second step...
    How can I see every runned macros as a list in the same UserForm ?
    I mean I want to see every runned macros as a list not only the last macro...

  17. #17
    Forum Contributor HerryMarkowitz's Avatar
    Join Date
    09-10-2012
    Location
    Europe
    MS-Off Ver
    Office 2021 - Win10
    Posts
    1,007

    Re: List of last running macros


+ 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] Running macros by making a selection in a dropdown list
    By blueshift1 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-06-2012, 02:22 PM
  2. Running Macros
    By in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-10-2006, 04:19 PM
  3. Running Macros
    By in forum Excel General
    Replies: 1
    Last Post: 07-06-2006, 11:25 AM
  4. [SOLVED] Running Macros
    By in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 07-06-2006, 10:45 AM
  5. [SOLVED] running macros
    By Jay in forum Excel General
    Replies: 2
    Last Post: 04-28-2005, 08:06 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