How do I alter this AutoSave code?

G

Guest

There is a workbook used by many different users in my department. We
encounter a problem when someone opens the workbook and then forgets to close
it.

To eliminate this problem, I wrote in some code that automatically closes
the workbook after it has been open for 20 minutes. The procedure works fine
but I have a glitch. I (and I'm assuming others as well) run AutoSave (set
to prompt before saving). The problem occurs when the autosave promt comes
up and I don't respond to the prompt. When this happens, the procedure I
wrote is suspended until I respond to the prompt.

The following code runs the autosave.

Application.Run Range("AUTOSAVE.XLA!mcs02.OnTime")

Can I do something to surpress this line when the workbook is opened or when
this line attempts to run?

-

Also, it would work better if I could set the workbook to close if the
window for that workbook has been inactive for 3 minutes instead of
automatically after 20 minutes. Can anyone suggest something I could use for
that?

any suggestions are appreciated.
 
G

Guest

You could try placing application.displayalerts = false before calling
autosave. Make sure to turn it back on afterwards.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top