+ Reply to Thread
Results 1 to 4 of 4

Run vba sub after a period of workbook inactivity

  1. #1
    Registered User
    Join Date
    09-22-2012
    Location
    london, england
    MS-Off Ver
    Excel 2011
    Posts
    25

    Run vba sub after a period of workbook inactivity

    Hi there,

    I can find lots of examples of closing a workbook after a period of inactivity but I can't find out how to run a macro.

    Please help if possible, thank you

    Hatrickx

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Run vba sub after a period of workbook inactivity

    To Add Excel VBA Code to a Workbook / This Workbook Module

    1. Copy the code that you want to use
    2. Select the workbook in which you want to store the code
    3. Hold the Alt key, and press the F11 key, to open the Visual Basic Editor
    4. In the Project Explorer, find your workbook, and open the list of Microsoft Excel Objects
    5. Right-click on the ThisWorkbook object, and choose View Code
    6. Where the cursor is flashing, choose Edit | Paste

    Please Login or Register  to view this content.


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Registered User
    Join Date
    09-22-2012
    Location
    london, england
    MS-Off Ver
    Excel 2011
    Posts
    25

    Re: Run vba sub after a period of workbook inactivity

    Ah yes I see what you are thinking I'm thinking!

    But what I have is a userform which I need to run a private sub whenever the user hasn't interacted with the userform for a certain amount of time. And without actually shutting the workbook itself as the userform must endure this process and be available to interact with at all times if possible.

    I wonder if this could be achievable?

  4. #4
    Registered User
    Join Date
    09-22-2012
    Location
    london, england
    MS-Off Ver
    Excel 2011
    Posts
    25

    Re: Run vba sub after a period of workbook inactivity

    So imagine a userform with commandbuttons and a black background.

    All I need is for the background to go red if no one has clicked any of the commandbuttons for 10 seconds.

    If it gets to between >0 & <10 seconds and a commandbutton is clicked then the count goes back to zero and the background stays black for now.

    I have a grasp of running timers but I can't get this to work...

+ 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. 2nd Close Workbook after inactivity
    By Dreamwine59 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 09-29-2017, 03:25 AM
  2. Excel vba close workbook after inactivity
    By vaneagle in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 03-11-2014, 11:58 PM
  3. [SOLVED] Automatically Save And Close Workbook After Period Of Inactivity
    By swordswinger710 in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 01-07-2014, 09:48 AM
  4. Close Workbook After Inactivity + Warning
    By thesonofdarwin in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-18-2013, 10:14 PM
  5. Close workbook due to inactivity.
    By Cyberpawz in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 06-21-2012, 10:56 AM

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