M
maxifire
Hi, I've been running this VBA program on Excel 2002 for quite some tim
until I've upgraded one of my computers to Excel 2003 and the progra
would generate an error:
Compile Error:
Can't find project or library.
May I know how do I go about solving this problem? Thanks!
Here's the code I use.
---
Sub OkBtn_Click()
Dim b As Integer
Dim uid As String ' a = userid
Dim pwd As String ' c = password
uid = UserNameTB.Value
pwd = PasswordTB.Value
Sheets("EmpList").Select
For b = 2 To 100
Cells(b, 2).Select
If ActiveCell.Value = uid Then
If ActiveCell.Offset(0, 1).Value = pwd Then
chkGrp
Else
MsgBox ("Invalid Password")
Unload Me
End If
Else:
End If
ActiveCell.Offset(1, 0).Select
Next b
Cells(1, 1).Select
End Sub
Sub chkGrp()
Sheets("EmpList").Activate
With TimesheetEntry.TSENameCB
For Row = 7 To 106
TimesheetEntry.TSENameCB.AddIte
Sheets("EmpList").Cells(Row, 2)
Next Row
End With
If ActiveCell.Offset(0, 2).Value = "N" Then
Unload Me
TimesheetEntry.TSENameCB.Text = UserNameTB.Value
TimesheetEntry.Show
ElseIf ActiveCell.Offset(0, 2).Value = "A" Then
Unload Me
TimesheetEntry.TSENameCB.Text = UserNameTB.Value
LoginOption.Show
End If
End Sub
until I've upgraded one of my computers to Excel 2003 and the progra
would generate an error:
Compile Error:
Can't find project or library.
May I know how do I go about solving this problem? Thanks!
Here's the code I use.
---
Sub OkBtn_Click()
Dim b As Integer
Dim uid As String ' a = userid
Dim pwd As String ' c = password
uid = UserNameTB.Value
pwd = PasswordTB.Value
Sheets("EmpList").Select
For b = 2 To 100
Cells(b, 2).Select
If ActiveCell.Value = uid Then
If ActiveCell.Offset(0, 1).Value = pwd Then
chkGrp
Else
MsgBox ("Invalid Password")
Unload Me
End If
Else:
End If
ActiveCell.Offset(1, 0).Select
Next b
Cells(1, 1).Select
End Sub
Sub chkGrp()
Sheets("EmpList").Activate
With TimesheetEntry.TSENameCB
For Row = 7 To 106
TimesheetEntry.TSENameCB.AddIte
Sheets("EmpList").Cells(Row, 2)
Next Row
End With
If ActiveCell.Offset(0, 2).Value = "N" Then
Unload Me
TimesheetEntry.TSENameCB.Text = UserNameTB.Value
TimesheetEntry.Show
ElseIf ActiveCell.Offset(0, 2).Value = "A" Then
Unload Me
TimesheetEntry.TSENameCB.Text = UserNameTB.Value
LoginOption.Show
End If
End Sub