View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Benoit Lamarche Benoit Lamarche is offline
external usenet poster
 
Posts: 2
Default Close excel when inactive


I think it should be:

ans = MsgBox("About to close, click Cancel to stop.", vbOKCancel)

(missing a bracket)

Also, when I try to run the code, I get:

nSaveWB (variable not defined)

and also, after trying to run "Public Sub Shutdown"

I get "Only comments may appear after End Sub ..."

All the code is in the worksheet's property, is that what's intended?


--
Benoit Lamarche


"Bob Phillips" wrote:

...
Public Sub Shutdown()
Dim ans
ans = MsgBox"About to close, click Cancel to stop.", vbOKCancel)
If vbOK Then
Application.Quit
Else
SetShutdownTimer
End If
End Sub