Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

123 Preclose event 1

Status
Not open for further replies.

NevG

Programmer
Oct 10, 2000
162
GB
Hi troops

I have a ssheet that calcs peoples salary from millions of stupid numbers. I have a function that fries the whole thing off.

My problem is that my clients have a tendancy to hit the little X button inthe corner to close the sheet and I cant figure out how to cancel this event.

I want to try and stop them from closing it if they have changed things and not recalculated the ssheet. Can I trap the X button being pressed?

How ??

Much help needed on this ASAP people

Thanks

nev
 
Maybe a bit late, but perhaps the following sample Script from the LotusScript Help is a little help for you.
Regards

Rainer

Code:
' The following PreClose event displays a message box which asks whether the
' user really wants to close the document. If the user clicks YES, the
' PostClose event is never raised.

Function PreClose(Source As Document, P1 As Variant) As Variant
	r = Msgbox("Close this document?", 4, "Confirmation")
	If r = 6 Then
		' User clicked YES. 
		' Continue the close.
		PreClose = $Continue
	Else
		' User clicked NO.
		' Block the close and raise PostClose.
                PreClose = $Block	
	End If
End Function

' PostClose is raised only when PreClose returns $Block.
Sub PostClose(Source As Document, P1 As Variant)
	Msgbox "Closure has been blocked!",,"1-2-3"
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top