+ Reply to Thread
Results 1 to 14 of 14

Have a message box repeat on timer

  1. #1
    Valued Forum Contributor scaffdog845's Avatar
    Join Date
    02-01-2008
    Location
    Aston, PA. USA.
    MS-Off Ver
    Microsoft 365
    Posts
    373

    Have a message box repeat on timer

    Hey gang. I have a file shared amongst my organization that I need to access at a certain time to update. The file has often been left open and unattended on users desktops. I've inserted the following code under the THIS WORKBOOK module to give the users a prompt whne opening the workbook to exit in a timely fashion.
    Please Login or Register  to view this content.
    Is there a way to get this message to reappear at a certain time interval like every 5 minutes the file is open?
    Click here to read the Forum Rules
    Whatever it is in life you decide to go after, go after with great ferocity.

  2. #2
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: Have a message box repeat on timer

    .
    You would be better served to include a macro that auto-saves the file at X minutes after opening and auto closes.

  3. #3
    Registered User
    Join Date
    05-08-2019
    Location
    London, England
    MS-Off Ver
    2016
    Posts
    2

    Re: Have a message box repeat on timer

    There's a solution here:

    stackoverflow.com/questions/22772898/how-to-have-vba-execute-every-10-minutes

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Last edited by jeffreybrown; 07-24-2019 at 02:14 PM. Reason: Please use code tags!

  4. #4
    Valued Forum Contributor scaffdog845's Avatar
    Join Date
    02-01-2008
    Location
    Aston, PA. USA.
    MS-Off Ver
    Microsoft 365
    Posts
    373

    Re: Have a message box repeat on timer

    I like that idea. Within our facility there are three users that need wide open access to this file for editing purposes and can not be time limited to how long they have ownership of the file. There are several hundred other users that need to open the file to simply view scheduled work. From an editor's standpoint the issue comes when a "Viewer" opens a file and walks away from the computer for hours with it open. I can always get IT to kick them out of the file but it's a daily pain in the aught.

  5. #5
    Registered User
    Join Date
    10-12-2015
    Location
    Bristol, UK
    MS-Off Ver
    Office 365
    Posts
    39

    Re: Have a message box repeat on timer

    As you have a usage distinction between editors and viewers, you could save the file with a password to modify - that way it opens as read-only for your viewers and guarantees that your editors will have the file available to edit at any time.

    You would need to balance an approach like this with the need to keep the data current (if a viewer has the file open as read-only, they won't see any edits made until they open it again). Depending on the design of the file, you may be able to separate the data that will be updated into a table object, then have two copies of the file, one that you edit, and one that links to the edited file (and is accessed by your viewers) through that table object. You can set the connection to auto-refresh every few minutes, so the viewers see whatever is the latest save in your master file, and can have the file open as much as they want without impacting other users or running the risk of out of date data.

    I know this is the VBA forum, I just want to highlight a potential out-of-the-box solution too.

  6. #6
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: Have a message box repeat on timer

    .
    Based on your last post ... I wonder if it would be better for each individual to have a copy of the Master File on their computer. They can do anything they want with their own copy.
    Then have the original Master File on the server periodically 'pole' each user's copy to obtain updates and provide each user with the updated file ?

    That's a rather convoluted approach to the solution but it does allow everyone to do what they want and not interfere with others.


    Overall your situation is .. to put it bluntly ... a mess. A few individuals need unfettered access with their file access ongoing. Others only need to access the file periodically and are
    contributing to the issue.

    Bottom line ... someone needs to effect disciplinary action on the violators or ... simply ignore the issue and tell everyone when they can play in the sand box nicely their problem will
    go away.

  7. #7
    Valued Forum Contributor scaffdog845's Avatar
    Join Date
    02-01-2008
    Location
    Aston, PA. USA.
    MS-Off Ver
    Microsoft 365
    Posts
    373

    Re: Have a message box repeat on timer

    Logit. It a posted schedule for a large industrial complex. Everyone needs to have access to it to look at the workers coming to their areas for the day, but there are only three of us that are suppose to edit the file. The issue is people opening it up then leaving it open for hours while they are away from there desk. Then when an editor goes to use it, the file is locked. Current solution is to high IT release the file.

  8. #8
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,286

    Re: Have a message box repeat on timer

    Similar issue here a few years back so I added code to close workbook after a duration. Ill see can I find workbook with code that may help

  9. #9
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,286

    Re: Have a message box repeat on timer

    You can display a message or close the workbook. Set to 15 seconds
    Attached Files Attached Files

  10. #10
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: Have a message box repeat on timer

    I suggest adding a macro that checks for lack of any activity. Say after 3 minutes or so, it auto closes the file. Let me know if you are interested in the code.

  11. #11
    Valued Forum Contributor scaffdog845's Avatar
    Join Date
    02-01-2008
    Location
    Aston, PA. USA.
    MS-Off Ver
    Microsoft 365
    Posts
    373

    Re: Have a message box repeat on timer

    Thanks for the file Nigelog. I'm not very well versed in VBA. The file produces several Runtime errors on opening.

  12. #12
    Valued Forum Contributor scaffdog845's Avatar
    Join Date
    02-01-2008
    Location
    Aston, PA. USA.
    MS-Off Ver
    Microsoft 365
    Posts
    373

    Re: Have a message box repeat on timer

    Logit I think your suggested solution to auto save and close on a certain period of inactivity would be helpful. Thanks, I would be interested in that code..

  13. #13
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: Have a message box repeat on timer

    .
    Here is part of the code:

    Please Login or Register  to view this content.
    Review the entire workbook for all the code.
    Attached Files Attached Files

  14. #14
    Valued Forum Contributor scaffdog845's Avatar
    Join Date
    02-01-2008
    Location
    Aston, PA. USA.
    MS-Off Ver
    Microsoft 365
    Posts
    373

    Re: Have a message box repeat on timer

    Sorry it took me so long to get back in here and see this Logit. I follow the logic and it makes sense however it generates a VB error '1004' Method 'OnTime' of object'_Application' failed on the line
    Please Login or Register  to view this content.

+ 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. Countdown timer Working BUT starting the timer repeatedly SPEEDS UP TIMER!
    By Vinospam in forum Excel Programming / VBA / Macros
    Replies: 67
    Last Post: 03-30-2019, 06:42 PM
  2. Replies: 4
    Last Post: 04-19-2018, 08:53 AM
  3. [SOLVED] Set countdown timer, then pop-up message when complete
    By aftbrah in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-30-2016, 02:52 PM
  4. YesNo Message box auto click timer
    By mcinnes01 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-30-2012, 09:20 AM
  5. Show text message instead of egg timer while macro runs
    By CasualVisitor in forum Excel General
    Replies: 2
    Last Post: 09-25-2009, 02:39 PM
  6. [SOLVED] Message Box with a Timer
    By tom in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-17-2006, 03:40 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