Trouble with exit

J

jose luis

Thanks again Ron for your time and patience.


I can't make it work . More advice will be greatly appreciated. Here i
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). Estamo
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 tha
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 leave
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 O
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 keep
running and what is worst deprotects the sheets and allows the user t
see the hidden sheet.

Could you help me to See what i doing wrong?

Thanks again


jose lui
 
R

Ron de Bruin

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
 

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