auto open, auto close

M

mike allen

I use this to reset user's computer to original calculation setting. It
works (I think), but upon closing, it prompts you: "Do you want to save the
changes you made..." This occurs even if I just saved it. I wish to not
see this message. I am trying to tell it not to prompt me, but to no avail.
A novice user reluctant to NOT save his work will hit 'yes' (save) to this
message over and over upon closing and wonder what they are doing wrong.

Public origcalc As Integer

Sub Auto_Open()
If Application.Calculation = xlAutomatic Then
origcalc = 1
Else
origcalc = 0
End If
Application.Calculation = xlAutomatic
End Sub

Sub auto_close()
If origcalc = 1 Then
Else
Application.Calculation = xlManual
End If
Application.DisplayAlerts = False 'THIS IS WHAT DOESN'T WORK
End Sub

Thanks, Mike Allen
 
B

Bob Phillips

Mike,

Try

Sub auto_close()
If origcalc = 1 Then
Else
Application.Calculation = xlManual
End If
Thisworkbook.saved=true
End Sub


--

HTH

RP
(remove nothere from the email address if mailing direct)
 

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