Results 1 to 9 of 9
  1. #1
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Error: Method 'FullPath' of object 'Reference' failed

    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
    ====================

  2. #2
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    9,433
    Thanks
    371
    Thanked 1,456 Times in 1,325 Posts
    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 Files\Microsoft Shared\VBA\VBA6\VBE6.DLL
    Access: C:\Program Files (x86)\Microsoft Office\OFFICE11\MSACC.OLB
    stdole: C:\Windows\SysWOW64\stdole2.tlb
    DAO: C:\Program Files (x86)\Common Files\Microsoft Shared\DAO\dao360.dll
    Office: C:\Program Files (x86)\Common Files\Microsoft Shared\OFFICE11\MSO.DLL
    ADODB: C:\Program Files (x86)\Common Files\System\ado\msado21.tlb
    Scripting: C:\Windows\SysWOW64\scrrun.dll
    Excel: C:\Program Files (x86)\Microsoft Office\OFFICE11\EXCEL.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

    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.
    Last edited by RetiredGeek; 2013-02-15 at 11:13.
    May the Forces of good computing be with you!

    RG

    PowerShell & VBA Rule!

    My Systems: Desktop Specs
    Laptop Specs

  3. #3
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks for the response, I ran it again with your suggestion and got the following:

    ?SaveReferences("Clerk.ref")
    VBA: C:\Program Files (x86)\Common Files\Microsoft Shared\VBA\VBA6\VBE6.DLL
    Access: C:\Program Files (x86)\Microsoft Office\OFFICE11\MSACC.OLB
    stdole: C:\Windows\SysWOW64\stdole2.tlb
    DAO: C:\Program Files (x86)\Common Files\Microsoft Shared\DAO\dao360.dll
    VBIDE: C:\Program Files (x86)\Common Files\Microsoft Shared\VBA\VBA6\VBE6EXT.OLB
    Office: C:\Program Files (x86)\Common Files\Microsoft Shared\OFFICE11\MSO.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:\Windows\System32\comctl32.ocx (date & time stamp 6/24/1998 596KB ActiveX control)

    Microsoft Word 14.0 Object Library
    C:\Program Files (x86)\Microsoft Office\Office14\MSWORD.OLB

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

    Microsoft ActiveX Data Objects 2.1 Library
    C:\Program Files (x86)\Common Files\System\ado\msado21.tlb

    Any help is welcomed

  4. #4
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    9,433
    Thanks
    371
    Thanked 1,456 Times in 1,325 Posts
    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.
    May the Forces of good computing be with you!

    RG

    PowerShell & VBA Rule!

    My Systems: Desktop Specs
    Laptop Specs

  5. #5
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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 Files\Microsoft Shared\VBA\VBA6\VBE6.DLL
    Access: C:\Program Files (x86)\Microsoft Office\OFFICE11\MSACC.OLB
    stdole: C:\Windows\SysWOW64\stdole2.tlb
    DAO: C:\Program Files (x86)\Common Files\Microsoft Shared\DAO\dao360.dll
    VBIDE: C:\Program Files (x86)\Common Files\Microsoft Shared\VBA\VBA6\VBE6EXT.OLB
    Office: C:\Program Files (x86)\Common Files\Microsoft Shared\OFFICE11\MSO.DLL
    Word: C:\Program Files (x86)\Microsoft Office\Office14\MSWORD.OLB
    TILT12Lib: C:\Program Files (x86)\Tilt12\Tilt12.dll
    ADODB: C:\Program Files (x86)\Common Files\System\ado\msado21.tlb

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

    C:\Windows\System32\comctl32.ocx is there

    Tried to regsvr32 C:\windows\system32\COMCTL32.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?

  6. #6
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    9,433
    Thanks
    371
    Thanked 1,456 Times in 1,325 Posts
    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
    May the Forces of good computing be with you!

    RG

    PowerShell & VBA Rule!

    My Systems: Desktop Specs
    Laptop Specs

  7. #7
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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:\Windows\System32 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

  8. #8
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts
    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
    Wendell

  9. #9
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks for information

Posting Permissions

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