Consulting

Results 1 to 4 of 4

Thread: Compile Errror: Can't Find Project or Library

  1. #1

    Compile Errror: Can't Find Project or Library

    P.S. - NOT Initialization, but Declaration
    Hi,
    A macross I developed home refuses to work at home.
    I get the following error:
    index_error.jpg
    I get the same on 'for each' loop, so I reworked one loop to have the looped item as Variant, but this is insane, don't want to do this for all loops...
    The index loop works if I declare:
    Sub test_sql_str()
        Dim i As Integer
        For i = 1 To 5
        Debug.Print "sdf"
        Next i
    End Sub
    Strangely enough, the macros worked as is at home and If I start macro in a fresh excel file, I can use loops as usual.
    No need to initialize index and for each variables.

    Tried to search descriptevily google about this, but not sure how to formulate the problem.

    Regards

  2. #2
    VBAX Master Aflatoon's Avatar
    Joined
    Sep 2009
    Location
    UK
    Posts
    1,768
    Location
    That error is usually down to a Reference problem (in the VB Editor, click Tools - References and look for any checked items that start with 'MISSING:'

    However, recent updates to office have caused very odd problems in workbooks that use activex controls - does yours?
    Be as you wish to seem

  3. #3
    Thx
    MISSING: Microsoft Windows Common Controls-2.6.0(SP6)
    C:Windows\System32\mscomct2.ocx
    ----
    P.S. SOLUTION:
    support2.microsoft.com/kb/297381
    ----
    Downloaded the archive and put the files (MSCOMCT2.OCX) where the references dialog showed location for the missing references:
    (C:Windows\System32\mscomct2.ocx or wherever the references dialog shows you)
    Now works
    Last edited by emosms; 01-06-2015 at 08:10 AM. Reason: Solved!

  4. #4
    The error occurs as the application has lost the reference to an object or type library resulting in the above error when using Barcode Macros & Native VBA Functions. The problem may be resolved by following the given solution:


    1. Open the database or application.
    2. Open a module in Design view or press ALT+F11 to switch to the Visual Basic Editor.
    3. On the Tools menu, click References.
    4. Clear the check box for the type library or object library marked as "Missing:"

    Another solution is to remove the reference is to restore the referenced to the path specified in the References dialogue box. If the referenced file is in a new location, clear the "Missing:" reference and create a new reference to the file in its new location.
    Last edited by Jacob Hilderbrand; 07-17-2017 at 09:15 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •