Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
JackR
 
Posts: n/a
Default help with this error-Compile error: cant find project or library

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
  #2   Report Post  
Posted to microsoft.public.excel.misc
Norman Jones
 
Posts: n/a
Default help with this error-Compile error: cant find project or library

Hi Jack,

With the workbook in question active, run the problematic code
When the code errors, go to the VBE and select the project in the Project
Explorer Window

Hit the reset button and look at the Tools | References list

Look for any references marked as "MISSING".

Either uncheck the reference or, if the reference is needed, try the browse
button to locate the library,


---
Regards,
Norman


"JackR" wrote in message
...
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



  #3   Report Post  
Posted to microsoft.public.excel.misc
JackR
 
Posts: n/a
Default help with this error-Compile error: cant find project or libra

Thank you, that took care of the problem

"Norman Jones" wrote:

Hi Jack,

With the workbook in question active, run the problematic code
When the code errors, go to the VBE and select the project in the Project
Explorer Window

Hit the reset button and look at the Tools | References list

Look for any references marked as "MISSING".

Either uncheck the reference or, if the reference is needed, try the browse
button to locate the library,


---
Regards,
Norman


"JackR" wrote in message
...
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




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Missing library when running 98 project on 2003 Mary Omond Excel Discussion (Misc queries) 0 May 2nd 05 01:36 PM
Find project start and end dates in a DB with many different proje AceWriter01 Excel Worksheet Functions 3 April 1st 05 03:58 AM
Missing Library Jan Il Excel Worksheet Functions 2 March 19th 05 05:56 PM
Excel has a "Find Next" command but no "Find Previous" command. Michael Fitzpatrick Excel Discussion (Misc queries) 2 January 11th 05 12:45 AM
Can't find project or library Tracey Excel Discussion (Misc queries) 4 January 5th 05 06:19 PM


All times are GMT +1. The time now is 11:23 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"