• Error: Method ‘FullPath’ of object ‘Reference’ failed

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Error: Method ‘FullPath’ of object ‘Reference’ failed

    Author
    Topic
    #487807

    I have the following module that works OK in:

    Windows XP Access 2000 and Access 2003

    When I run on Windows 7 Access 2003 I’m getting the following error:

    Microsoft Visual Basic
    Run-time error ‘-2147319779 (8002801d)’:
    Method ‘FullPath’ of object ‘Reference’ failed

    with Print #1, Ref.Name; “;”; Ref.FullPath highlighted in yellow

    Any help is welcomed

    John
    11397335

    ===========================
    ‘ To run type ?SaveReferences(“Clerk.ref”)

    Function SaveReferences(Optional strFileName)

    Dim Ref As Reference
    Dim strTmp As String
    If IsMissing(strFileName) Then
    strTmp = CurrentDb.Name
    strFileName = Mid(strTmp, 1, InStr(strTmp, Dir(strTmp)) – 1) & “REFERENCES_”
    strTmp = Dir(CurrentDb.Name)
    strFileName = strFileName & Mid(strTmp, 1, InStr(strTmp, “.”) – 1) & “.TXT”
    End If

    Open strFileName For Output As #1
    For Each Ref In Application.References
    If Not Ref.IsBroken Then
    Print #1, Ref.Name; “;”; Ref.FullPath
    End If
    Next Ref
    Close #1

    End Function
    ====================

    Viewing 3 reply threads
    Author
    Replies
    • #1375017

      John,

      I tested your code on my laptop w/Win-7 64Bit and Office 2003 and did NOT have any problems.
      Here’s the slightly modified code I used the only changes are to direct output to the Immediate window vs the file as it didn’t seem like a file access problem.

      Code:
      Function SaveReferences(Optional strFileName)
      
         Dim Ref As Reference
         Dim strTmp As String
         
         If IsMissing(strFileName) Then
           strTmp = CurrentDb.Name
           strFileName = Mid(strTmp, 1, InStr(strTmp, Dir(strTmp)) - 1) & "REFERENCES_"
           strTmp = Dir(CurrentDb.Name)
           strFileName = strFileName & Mid(strTmp, 1, InStr(strTmp, ".") - 1) & ".TXT"
         End If
      
      '   Open strFileName For Output As #1
         
         For Each Ref In Application.References
            If Not Ref.IsBroken Then
      '        Print #1, Ref.Name; ";"; Ref.FullPath
               Debug.Print Ref.Name; ": "; Ref.FullPath
            End If
         Next Ref
      '   Close #1
      
      End Function
      

      Here are the results as shown in the immediate window.

      ?SaveReferences
      VBA: C:Program Files (x86)Common FilesMicrosoft SharedVBAVBA6VBE6.DLL
      Access: C:Program Files (x86)Microsoft OfficeOFFICE11MSACC.OLB
      stdole: C:WindowsSysWOW64stdole2.tlb
      DAO: C:Program Files (x86)Common FilesMicrosoft SharedDAOdao360.dll
      Office: C:Program Files (x86)Common FilesMicrosoft SharedOFFICE11MSO.DLL
      ADODB: C:Program Files (x86)Common FilesSystemadomsado21.tlb
      Scripting: C:WindowsSysWOW64scrrun.dll
      Excel: C:Program Files (x86)Microsoft OfficeOFFICE11EXCEL.EXE

      You might try this variation as it will show the results in the immediate window and you can see if it processes some of the references and then chokes on a particular one. Also when you get the error message you can use the immediate window to print the values stored in the variables to see what might be causing the error. Just precede the variable name with a ? and hit enter.

      HTH :cheers:

      P.S. I went back and tested the original code writing to a file and it worked also. Just wanted to test my theory that is was not a file problem.

      May the Forces of good computing be with you!

      RG

      PowerShell & VBA Rule!
      Computer Specs

      • #1375175

        Thanks for the response, I ran it again with your suggestion and got the following:

        ?SaveReferences(“Clerk.ref”)
        VBA: C:Program Files (x86)Common FilesMicrosoft SharedVBAVBA6VBE6.DLL
        Access: C:Program Files (x86)Microsoft OfficeOFFICE11MSACC.OLB
        stdole: C:WindowsSysWOW64stdole2.tlb
        DAO: C:Program Files (x86)Common FilesMicrosoft SharedDAOdao360.dll
        VBIDE: C:Program Files (x86)Common FilesMicrosoft SharedVBAVBA6VBE6EXT.OLB
        Office: C:Program Files (x86)Common FilesMicrosoft SharedOFFICE11MSO.DLL

        with Print #1, Ref.Name; “;”; Ref.FullPath highlighted in yellow
        ComctlLib

        Ref.Name = ComctlLib

        Looks like it choked on the following reference:

        Microsoft Windows Common Controls 5.0 (SP2)
        C:WindowsSystem32comctl32.ocx (date & time stamp 6/24/1998 596KB ActiveX control)

        Microsoft Word 14.0 Object Library
        C:Program Files (x86)Microsoft OfficeOffice14MSWORD.OLB

        Tilt 1.2 MultiLabel Type Library
        C:Program Files (x86)Tilt12Tilt12.dll

        Microsoft ActiveX Data Objects 2.1 Library
        C:Program Files (x86)Common FilesSystemadomsado21.tlb

        Any help is welcomed

    • #1375182

      John,

      Did you look under references to see if that reference is selected and did you check the indicated location to see if the file is there?
      Also why is there a reference to Office 2010 for Word? {Office 14 is 2010}?
      You could also use the References menu to reorder the references and move the offending one to the bottom of those selected and see it all the rest show up and it chokes on the last one. :cheers:

      May the Forces of good computing be with you!

      RG

      PowerShell & VBA Rule!
      Computer Specs

      • #1375204

        The customer has installed:

        Microsoft Office Home and Student 2010 and Microsoft Office Professional Edition 2003

        I ran it again after your suggestion and got a little further
        ?SaveReferences(“Clerk.ref”)
        VBA: C:Program Files (x86)Common FilesMicrosoft SharedVBAVBA6VBE6.DLL
        Access: C:Program Files (x86)Microsoft OfficeOFFICE11MSACC.OLB
        stdole: C:WindowsSysWOW64stdole2.tlb
        DAO: C:Program Files (x86)Common FilesMicrosoft SharedDAOdao360.dll
        VBIDE: C:Program Files (x86)Common FilesMicrosoft SharedVBAVBA6VBE6EXT.OLB
        Office: C:Program Files (x86)Common FilesMicrosoft SharedOFFICE11MSO.DLL
        Word: C:Program Files (x86)Microsoft OfficeOffice14MSWORD.OLB
        TILT12Lib: C:Program Files (x86)Tilt12Tilt12.dll
        ADODB: C:Program Files (x86)Common FilesSystemadomsado21.tlb

        Choked on:
        Microsoft Windows Common Controls 5.0 (SP2)
        C:WindowsSystem32comctl32.ocx (date & time stamp 6/24/1998 596KB ActiveX control)

        C:WindowsSystem32comctl32.ocx is there

        Tried to regsvr32 C:windowssystem32COMCTL32.OCX and got:

        The module “comctl32.ocx” failed to load

        Where can I download a valid copy of “comctl32.ocx” that works with my setup?

    • #1375210

      John,

      Office 2003 and 2010 do not play particularly well together.
      I would encourage your client to choose one or the other.
      Note if they choose 2003 you can download the Office File Compatibility Pack from MS so they can still open and use files from office 2007/10.

      I think that as long as you have two versions you are going to have problems with references. Of course you could change your code to use Late Binding which should solve some if not all of the references problems. Of course along with that it the loss of some functionality in the VBE environment for the object members auto completion feature.

      HTH :cheers:

      May the Forces of good computing be with you!

      RG

      PowerShell & VBA Rule!
      Computer Specs

      • #1375507

        After further review I replaced comctl32.ocx from another working computer and all is well on troubled computer so far

        Can you tell me something about comctl32.ocx?

        My working comctl32.ocx is dated 6/24/1998 596KB ActiveX control

        When installing Access (any version 2000-2010) over the past 12 years, I would simply copy comctl32.ocx from a working computer to C:WindowsSystem32 and all was well

        I there a more current version of comctl32.ocx I should be using? if so, where do I get it on the Internet?

        Thanks for all your help

    • #1375696

      Doing a search on “latest version of comctl32.ocx” yields a number of hits – the Microsoft Support article indicates the most recent version was released in 2003

    Viewing 3 reply threads
    Reply To: Error: Method ‘FullPath’ of object ‘Reference’ failed

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: