help with this error-Compile error: cant find project or library

Giganews Newsgroups
Subject: help with this error-Compile error: cant find project or library
Posted by:  JackR
Date: Fri, 9 Jun 2006

I am getting an error message saying: Compile error: Cant find project or
library. All I did was copy this worksheet onto my laptop, it worked fine on
mt PC now I get this error message, I am desperate to get an answer as I need
to do a presention to 20 people on this on Sunday, any help PLEASE!!

Private Sub UserForm_Activate()
    DefineList
    BubbleSort
    CKsorted.Value = True
    Book = ActiveWorkbook.Name
    GotoSheet.Caption = "VIEW RECIPES AND TABS"
    TB1.Value = Book & ":  " & LB1.ListCount & " Sheets"
End Sub

Private Sub CKsorted_Click()
    If CKsorted.Value = False Then DefineList Else BubbleSort
End Sub

Private Sub LB1_Click()
    Sheets(LB1.Value).Activate
End Sub

Private Sub LB1_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
    GotoSheet.Hide
End Sub

Sub DefineList()
    LB1.Clear

    w = ActiveWorkbook.Worksheets.Count
    c = ActiveWorkbook.Charts.Count
    n = w + c

    ReDim MyArray(n, 1)
    For i = 0 To w - 1
        MyArray(i, 0) = Sheets(i + 1).Name
        If Sheets(MyArray(i, 0)).Visible Then MyArray(i, 1) = "" _
            Else MyArray(i, 1) = "Hidden"
    Next i
    a = 0
    For i = w To n - 1
        a = a + 1
        MyArray(i, 0) = Charts(a).Name
        If Charts(MyArray(i, 0)).Visible Then MyArray(i, 1) = "Chart" _
            Else MyArray(i, 1) = "Hid Chart"
    Next i

    LB1.List = MyArray

End Sub

Sub BubbleSort()
    w = ActiveWorkbook.Worksheets.Count
    c = ActiveWorkbook.Charts.Count
    n = w + c
    ReDim SortArray(n - 1, 1) As String

    For i = 0 To w - 1
        SortArray(i, 0) = Sheets(i + 1).Name
        If Sheets(SortArray(i, 0)).Visible Then SortArray(i, 1) = "" _
            Else SortArray(i, 1) = "Hidden"
    Next i
    a = 0
    For i = w To n - 1
        a = a + 1
        SortArray(i, 0) = Charts(a).Name
        If Charts(SortArray(i, 0)).Visible Then SortArray(i, 1) = "Chart" _
            Else SortArray(i, 1) = "Hid Chart"
    Next i

    Do
        NoExchanges = True
'      Loop through each element in the array.
        For i = 0 To n - 2
'      If the element is greater than the element
'      following it, exchange the two elements.
            If SortArray(i, 0) > SortArray(i + 1, 0) Then
                NoExchanges = False
                Temp = SortArray(i, 0)
                Temp2 = SortArray(i, 1)
                SortArray(i, 0) = SortArray(i + 1, 0)
                SortArray(i, 1) = SortArray(i + 1, 1)
                SortArray(i + 1, 0) = Temp
                SortArray(i + 1, 1) = Temp2
            End If
        Next i
    Loop While Not (NoExchanges)
    LB1.List = SortArray

End Sub

Replies