ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Trouble with exit (https://www.excelbanter.com/excel-programming/310636-trouble-exit.html)

jose luis

Trouble with exit
 

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

--
jose lui
-----------------------------------------------------------------------
jose luis's Profile: http://www.excelforum.com/member.php...fo&userid=1331
View this thread: http://www.excelforum.com/showthread.php?threadid=26172


Ron de Bruin

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





All times are GMT +1. The time now is 03:55 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com