Here is what the code looks like when i "Click on the Excel Icon" to view the
code to enter the formula you supplied to me. Have i done something wrong i
entered the code all the way at the bottom. Keep in mind i didn't create this
program and have NEVER done Macros before. So the information you are
supplying to me is pretty much chinese. The tabs are still showing up when i
reopen the worksheet.
Private Sub Workbook_Open()
'check for solver
If (CheckSolver = False) Then
MsgBox "Solver Add-In is not installed, you will not be able to
solve least costing on the Auto-Balance sheet. Consult Excel help for
information 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
'load the workbook
loadworkbook
End Sub
Private Sub loadworkbook()
Application.ScreenUpdating = False
changeVisibility InstructionsSheet, xlSheetVisible
InstructionsSheet.Activate
changeVisibility RequirementsSheet, xlSheetVisible
changeVisibility EvaluateSheet, xlSheetVisible
changeVisibility AutoBalanceSheet, xlSheetVisible
changeVisibility HerdDescriptionSheet, xlSheetVisible
changeVisibility IngredientsSheet, xlSheetVisible
changeVisibility MixSheet, xlSheetVisible
changeVisibility ReportsEVSheet, xlSheetVisible
changeVisibility ReportsLCSheet, xlSheetVisible
changeVisibility ErrorSheet, xlSheetVeryHidden
Application.ScreenUpdating = True
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.ScreenUpdating = False
resetToStart
Geminator.Save
Application.ScreenUpdating = True
End Sub
Private Sub changeVisibility(Sheet As Worksheet, v As Integer)
unProtect "AmIn0"
Sheet.unProtect "AmIn0"
Sheet.Visible = v
Sheet.Protect "AmIn0"
Protect "AmIn0"
End Sub
Private Sub resetToStart()
changeVisibility ErrorSheet, xlSheetVisible
changeVisibility AutoBalanceSheet, xlSheetVeryHidden
changeVisibility EvaluateSheet, xlSheetVeryHidden
changeVisibility HerdDescriptionSheet, xlSheetVeryHidden
changeVisibility IngredientsSheet, xlSheetVeryHidden
changeVisibility MixSheet, xlSheetVeryHidden
changeVisibility InstructionsSheet, xlSheetVeryHidden
changeVisibility ReportsEVSheet, xlSheetVeryHidden
changeVisibility ReportsLCSheet, xlSheetVeryHidden
changeVisibility RequirementsSheet, xlSheetVeryHidden
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 WorkbookGeminator_BeforeClose(Cancel As Boolean)
Sheets("Requirements").Visible = xlVeryHidden
Sheets("MakeAMix").Visible = x1VeryHidden
Sheets("HerdDescription").Visible = x1VeryHidden
Sheets("Evaluate").Visible = x1VeryHidden
Sheets("AutoBalance").Visible = x1VeryHidden
Sheets("ReportAutoBalance").Visible = x1VeryHidden
Sheets("ReportsEvaluate").Visible = x1VeryHidden
ThisWorkbook.Save
End Sub