Results 1 to 2 of 2
  1. #1
    2 Star Lounger
    Join Date
    Jan 2002
    Trenton, Ontario
    Thanked 0 Times in 0 Posts

    Macro to Close a Workbook? (2000)

    Good Day,
    I have a spreadsheet that is stored in "Shared Data" on our company intranet. Many times people leave it open preventing me from making nessesary changes. Can I make a macro to close the entire workbook after say 10 minutes. Please bear in mind that I am a newbie at Macros.

  2. #2
    Bronze Lounger
    Join Date
    Jun 2001
    New York, New York, Lebanon
    Thanked 1 Time in 1 Post

    Re: Macro to Close a Workbook? (2000)


    Sure you can, but there's a better solution.

    If you would make the workbook shareable, Under the Tools menu choose Share Workbook, then that might help. But to answer your question, the macro needs to do these steps:

    1) At the time of the workbook is left unattended, a timer kicks in.
    2) The Timer reaches a specific time value, in your case 10 minutes, and issues a command, a message box, telling the User that the workbook is going to be closed.
    3a) If the User clicks OK the workbook is kept open
    3b) Otherwise after 30 seconds the workbook is saved and closed.

    The trick(s) is to know
    1) when the User has left the workbook unattended.
    2) To after issuing a message, to dismiss the message and save and close if the user is not there.

    I have done something like that in the past, but need some time to dig it out. Maybe by the weekend I'll send you a sample.

    <img src=/S/compute.gif border=0 alt=compute width=40 height=20> in the <img src=/S/bagged.gif border=0 alt=bagged width=22 height=22>

Posting Permissions

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