I am getting 'Compile error: Can't find project or library' in a only some Excel 2010 versions. Difficult to test this

74,007

In the VBA window, go to Tools --> References and ensure the same libraries are toggled on for all computers. Also make sure all active libraries are in the same order top-to-bottom.

Many libraries "come standard" but one may need to be toggled on. Or, a library reference may need to be toggled off due to a functional interference. A library may be altogether missing, but I doubt this is the case since it's a fairly standard suite and you aren't aware of having tinkered with it.

This is a typical issue and usually not considered too great a burden on your distribution clientele. If it is, you can rework your code to use fewer references; or you may be able to load the needed libraries programmatically (but I haven't ever tried that).

I suggest you include Option Explicit at the top of all modules. This problem looks a bit like a failure to declare your variables; and I think that requirement can vary by setting. Option Explicit will force all variables to be declared, which is beneficial in general and could cause all client installs to act the same.

Share:
74,007
Excel For Freelancers
Author by

Excel For Freelancers

I am a 13 year Digital Nomad, originally from Los Angeles California, however I have made South East Asia my home for those years, spending 10 years in Thailand and now 3 in Vietnam As a professional Excel Application Developer I have created both stand alone applications as well as hundreds of customized applications for small and medium sized business. My focus is now on teaching others how to use the power of Excel to design, develop and deploy applications so they can earn passive income without trading time for money I run Excel For Freelancers Private Facebook Group: I also have Free & Unique Training Videos on both my Facebook Page and YouTube Channel

Updated on March 10, 2020

Comments

  • Excel For Freelancers
    Excel For Freelancers about 4 years

    My customer is getting a Compile Error; Can't find project or Library on his version of Excel 2010, however i am not getting this on my version of 2010. How can i adjust this code so it will not appear. When the error appears in the following code the text "cell" in "For each cell in selection" is highlighted:

    Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Address = "$B$9" Then
    Columns("D:CB").Select
    Selection.EntireColumn.Hidden = False
    Application.ScreenUpdating = False
    
    Sheet17.Range("E48:CB48").Select
    
    For Each cell In Selection
        If cell = 0 Then
           Range(cell.Address).EntireColumn.Hidden = True
        End If
    Next
    
    Application.ScreenUpdating = True
    Sheet17.Range("b9").Select
    End If
    
    End Sub`
    

    My customer is also reporting a bug in the following code with the word "Response" being highlighted. This, as well, is not an issue for me, on my version of Excel 2010. Any and all help is greatly appreciated.

    If Sheet1.Range("E18") = 3 Then
    Response = MsgBox("Reminder Emails have been set to be sent automatically at " &               Sheet1.Range("f18").Value & ", " & Sheet1.Range("Q4").Value & " day(s) before" & vbCrLf & "the scheduled appointment. Do you want to send reminder e-mails now anyway?", vbYesNo)
        If Response = vbNo Then
        Exit Sub
        End If
        End If