Close Code possible?

L

LiAD

Hi,

I have a workbook with three sheets in it. Is it possible to create a code
that will automatically save and close the file after 5 minutes of no
usage/activity?

The file is used to record deliveries, the user is just hittin macro buttons
which either add one or subtract one from each product type as they are
delivered and consumed.

Could anyone help me with a code please?

Thanks
LiAD
 
L

LiAD

Works fine thanks.

Is it possible to modify this so it closes excel and the file rather than
just the file?

Thanks
 
L

LiAD

Hi,

It does work but now I'm trying to combine it with the rest of the codes I
have in this file and I can't get it to go with another one.

I have the code below to hide all the formula bars to limit the possibility
for the user to 'adapt' items on the file. How is it possible to combine
these codes with your code - I see your code does the opposite to this is
some cases if I understand it.

Sorry I'm useless with VB so this is getting past me.

Thanks a lot for your help
LiAD

application.OnKey "%{F11}","dummy"

and

Private mFormulaBar

Private Sub Workbook_BeforeClose()
Dim oCB As CommandBar
For Each oCB In Application.CommandBars
oCB.Enabled = True
Next oCB

Application.DisplayFormulaBar = mFormulaBar
End Sub

Private Sub Workbook_Open()
Dim oCB As CommandBar
For Each oCB In Application.CommandBars
oCB.Enabled = False
Next oCB

mFormulaBar = Application.DisplayFormulaBar
Application.DisplayFormulaBar = False
End Sub
 

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

Top