jinvictor
06-20-2006, 07:07 AM
i got 2 vbas to do the job for me.
first one control the times they used the workbook:
Private Sub Workbook_Open()
Dim incRange As Range
Set incRange = Range("Increment")
Sheets("hidden").Visible = xlVeryHidden
incRange = incRange + 1
Me.Save
If incRange > 10 Then
Application.DisplayAlerts = False
MsgBox "over the use limit, contact owner"
Me.Close
End If
End Sub
the second one controls how many days they can use:
Private Sub Workbook_Open()
Dim StartDate As Date
StartDate = "19/06/06" 'Date delivered to customer
If Date - StartDate > 14 Then ' Two week trial period
Application.DisplayAlerts = False
MsgBox "Trial period expired, contact owner"
Me.Close
End If
End Sub
how can i combine these 2 together, so i can use both of them to control the workbook?
first one control the times they used the workbook:
Private Sub Workbook_Open()
Dim incRange As Range
Set incRange = Range("Increment")
Sheets("hidden").Visible = xlVeryHidden
incRange = incRange + 1
Me.Save
If incRange > 10 Then
Application.DisplayAlerts = False
MsgBox "over the use limit, contact owner"
Me.Close
End If
End Sub
the second one controls how many days they can use:
Private Sub Workbook_Open()
Dim StartDate As Date
StartDate = "19/06/06" 'Date delivered to customer
If Date - StartDate > 14 Then ' Two week trial period
Application.DisplayAlerts = False
MsgBox "Trial period expired, contact owner"
Me.Close
End If
End Sub
how can i combine these 2 together, so i can use both of them to control the workbook?