This is possibly what you want, but without seeing a workbook its
difficult:
Private Sub Workbook_Open()
'check for solver
If (CheckSolver = False) Then
MsgBox "Solver Add-In is not installed, you will not be able to" &
vbNewLine & _
"solve least costing on the Auto-Balance sheet." & vbNewLine & _
"Consult Excel help forinformation on installing the Solver Add-In."
End If
'load the expiry date from cell Expiration!B1
Expiry = getExpirationDate
rightNow = Date
'if we have expired, or moved to a different machine
If (Expiry = Empty Or rightNow Expiry Or Not _
IsDataValid(getRegistrationNumber, getExpirationDate)) Then
showExpiryDialog
End If
Call Sheets_Hide
End Sub
Private Sub resetToStart()
setUseCount getUseCount + 1
If (getFirstUsed = Empty) Then
setFirstUsed Date
End If
Geminator.Protect "AmIn0"
End Sub
Private Sub showExpiryDialog()
registrationForm.regTextBox.SetFocus
registrationForm.regTextBox.SelStart = 0
registrationForm.regTextBox.SelLength = _
Len(registrationForm.regTextBox.Text)
registrationForm.Show
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Call Sheets_Hide
resetToStart
Geminator.Save
End Sub
Private Sub Sheets_Hide()
Dim ws As Worksheet
Application.ScreenUpdating = False
For Each ws In ThisWorkbook.Sheets
If ws.Name < "Instructions" Then
ws.Visible = xlSheetVeryHidden
End If
Next ws
Application.ScreenUpdating = True
End Sub
--
Simon Lloyd
Regards,
Simon Lloyd
'www.thecodecage.com' (
http://www.thecodecage.com)
------------------------------------------------------------------------
Simon Lloyd's Profile:
http://www.thecodecage.com/forumz/member.php?userid=1
View this thread:
http://www.thecodecage.com/forumz/sh...ad.php?t=27108