LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Exit when its a Mac

Hello, EveryBody. I been developing and application to run in the PC. I 'm
still working to run it in the Mac, but at this moment i would like to
prevent the users to try to run it in the Mac. The app already recognizes
when the PC is a Mac. Then I would like to close the application. Here is
what i wrote but still don't works. Could you give a hint on how to overcome
this situation? I think an instruction to leave the subroutine will be handy.
I already tried ThisWoorkBook.Close, the problem "remains the same"

Thanks in advace.

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




 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Run when exit PH NEWS Excel Worksheet Functions 1 July 18th 06 03:53 PM
Exit when its a Mac Tushar Mehta Excel Programming 0 September 21st 04 03:41 PM
exit sub mike allen[_2_] Excel Programming 4 August 6th 04 05:39 PM
If a called sub exit, how to the caller exit right away? luvgreen[_4_] Excel Programming 4 February 24th 04 05:06 PM
Exit Sub? Eva Shanley[_2_] Excel Programming 3 December 24th 03 02:15 PM


All times are GMT +1. The time now is 02:36 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"