ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How do I alter this AutoSave code? (https://www.excelbanter.com/excel-programming/376690-how-do-i-alter-autosave-code.html)

Ed

How do I alter this AutoSave code?
 
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.


JNW

How do I alter this AutoSave code?
 
You could try placing application.displayalerts = false before calling
autosave. Make sure to turn it back on afterwards.
--
JNW


"ed" wrote:

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.



All times are GMT +1. The time now is 02:41 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com