View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ron de Bruin Ron de Bruin is offline
external usenet poster
 
Posts: 11,123
Default Trouble with exit

Hi Jose

I can't test it for you because i don't have a Mac
Go to this newsgroup
microsoft.public.mac.office.excel


--
Regards Ron de Bruin
http://www.rondebruin.nl


"jose luis" wrote in message ...

Thanks again Ron for your time and patience.


I can't make it work . More advice will be greatly appreciated. Here is
what i coded.


Private Sub Workbook_Open()
Dim AddInTitle As String, Msg As String

#If Mac Then "Here checks if the System is Mac"
MsgBox "Aplicación para Windows (97 en adelante). Estamos
trabajando en la versión para Mac. Gracias por su comprensión."
Application.DisplayAlerts = False
ThisWorkbook.Close "In here doesn't close!
Application.DisplayAlerts = True
Exit Sub
#End If

If Not ValidaSeguridad Then "Here validates a Code that
i give the user
SaveSetting "TestNT", "Config", "Serie", ""
MsgBox "Solicite su Password etc., etc."
RegistroCodigo
If Not ValidaSeguridad Then "If the code is not good leaves
the worksheet"
ThisWorkbook.Saved = True
Application.DisplayAlerts = False
ThisWorkbook.Close
Application.DisplayAlerts = True
Exit Sub
End If
Else
End If

If ValidaSeguridad Then "If the Code is Ok
Procedes with the app
Application.ScreenUpdating = False
ThisWorkbook.Sheets(1).Activate
ThisWorkbook.Sheets(1).Range("A1").Select

On Error Resume Next
'-4105 xlAutomatic, -4135 xlManual
If Application.Calculation = -4135 Then
Application.Calculation = xlAutomatic
End If

Application.ScreenUpdating = True
On Error GoTo 0
MaximizaVentana

End If
End Sub


My problem is when it runs in the Mac. It doesn't Close. It keeps
running and what is worst deprotects the sheets and allows the user to
see the hidden sheet.

Could you help me to See what i doing wrong?

Thanks again


jose luis


--
jose luis
------------------------------------------------------------------------
jose luis's Profile: http://www.excelforum.com/member.php...o&userid=13312
View this thread: http://www.excelforum.com/showthread...hreadid=261729