View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
Brenda Brenda is offline
external usenet poster
 
Posts: 137
Default suggestions for another code

I JUST WANT TO SAY THANK YOU. There is no way i would have figured this out
and with you putting in the wording for me is greatly appreciated. From the
way everything looks it is working fine. This is a very complicated program
that was developed. Again, thank you.
--
Thank you, Brenda


"Simon Lloyd" wrote:


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