locked
Microsoft.Office.Interop.Access.ApplicationClass RRS feed

  • Question

  • Hi,

    I have a simple piece of code bellow,

    Imports Microsoft.Office.Interop

     

     

    Module Module1

     

        Sub Main()

            Dim oAccess As New Access.Application()

            Dim oExcel As New Excel.Application()

     

            oExcel.Visible = True

            oAccess.Visible = True

           

        End Sub

     

    End Module

     

    The code works fine to open Excel window but gives following error for Access

     

    Unable to cast COM object of type 'Microsoft.Office.Interop.Access.ApplicationClass' to interface type 'Microsoft.Office.Interop.Access._Application'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{68CCE6C0-6129-101B-AF4E-00AA003F0F07}' failed due to the following error: Error loading type library/DLL. (Exception from HRESULT: 0x80029C4A (TYPE_E_CANTLOADLIBRARY)).

     

    Any body knows why?

    Friday, February 16, 2007 6:58 PM

Answers

  • asdffgh,

    Thank you for your reply and sorry for my delay. Please read the following article and hope that can help you with the problem:

    Calling Visual Basic for Applications Code from Visual Basic .NET

    http://msdn2.microsoft.com/en-us/library/aa159913(office.11).aspx

    Using automation and COM Interop to combine the capabilities of Microsoft Visual Basic .NET applications with those of Microsoft Visual Basic for Applications (VBA) provides a convenient way to create solutions using the best of both. In this article, learn how to run VBA procedures in key Microsoft Office programs directly from Visual Basic .NET.

    Wednesday, March 7, 2007 7:01 AM

All replies

  • asdffgh,

    You might try downloading regmon.exe from www.sysinternals.com (recently aquired by Microsoft) and watching regkeys when you try to create a project.  Although this will generate a huge log as the system is touching regkeys all the time, you should be able to search for "Typelib" and find all of the attempts to access typelib keys (be sure to turn off logging first).  From there, you should be able to track down the cause of the problem.  Presumably, either the key itself won't exist, or the typelib referenced by the key is missing or corrupt.  You can test for the latter by opening the typelib in OleView.exe (available at http://www.microsoft.com/downloads/details.aspx?FamilyID=5233b70d-d9b2-4cb5-aeb6-45664be858b6&DisplayLang=en).

    Please take a look at the following link with the same problem but about Word:

    http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=674296&SiteID=1

    Monday, February 19, 2007 5:26 AM
  • Hi Bruno Yu,

    Thanks you very much for this information.

    I tried regmon and oleview and I found many entries for {68CCE6C0-6129-101B-AF4E-00AA003F0F07} in the regmon log. Results for some of them are success and for some it is not found. I am not sure how to use this information in oleview.

    Can you help me with the next step?

    I have attached the log

    Thanks

    asdffgh

    3:44:33 PM MSACCESS.EXE:3528 OpenKey HKCU\Software\Classes\Wow6432Node\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07} NOT FOUND  
    3:44:33 PM MSACCESS.EXE:3528 OpenKey HKCR\Wow6432Node\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07} SUCCESS  
    3:44:33 PM MSACCESS.EXE:3528 QueryKey HKCR\Wow6432Node\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07} SUCCESS Name: \REGISTRY\MACHINE\SOFTWARE\CLASSES\Wow6432Node\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07} 
    3:44:33 PM MSACCESS.EXE:3528 OpenKey HKCU\Software\Classes\Wow6432Node\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\ProxyStubClsid32 NOT FOUND  
    3:44:33 PM MSACCESS.EXE:3528 OpenKey HKCR\Wow6432Node\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\ProxyStubClsid32 SUCCESS  
    3:44:33 PM MSACCESS.EXE:3528 QueryKey HKCR\Wow6432Node\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\ProxyStubClsid32 SUCCESS Name: \REGISTRY\MACHINE\SOFTWARE\CLASSES\Wow6432Node\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\ProxyStubClsid32 
    3:44:33 PM MSACCESS.EXE:3528 OpenKey HKCU\Software\Classes\Wow6432Node\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\ProxyStubClsid32 NOT FOUND  
    3:44:33 PM MSACCESS.EXE:3528 QueryValue HKCR\Wow6432Node\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\ProxyStubClsid32\(Default) SUCCESS "{00020424-0000-0000-C000-000000000046}" 
    3:44:33 PM MSACCESS.EXE:3528 CloseKey HKCR\Wow6432Node\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\ProxyStubClsid32 SUCCESS  
    3:44:33 PM MSACCESS.EXE:3528 CloseKey HKCR\Wow6432Node\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07} SUCCESS  
    3:44:33 PM MSACCESS.EXE:3528 OpenKey HKCU\Software\Classes\Wow6432Node\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\ProxyStubClsid32 NOT FOUND  
    3:44:33 PM MSACCESS.EXE:3528 OpenKey HKCR\Wow6432Node\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\ProxyStubClsid32 SUCCESS  
    3:44:33 PM MSACCESS.EXE:3528 QueryKey HKCR\Wow6432Node\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\ProxyStubClsid32 SUCCESS Name: \REGISTRY\MACHINE\SOFTWARE\CLASSES\Wow6432Node\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\ProxyStubClsid32 
    3:44:33 PM MSACCESS.EXE:3528 OpenKey HKCU\Software\Classes\Wow6432Node\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\ProxyStubClsid32 NOT FOUND  
    3:44:33 PM MSACCESS.EXE:3528 QueryValue HKCR\Wow6432Node\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\ProxyStubClsid32\(Default) SUCCESS "{00020424-0000-0000-C000-000000000046}" 
    3:44:33 PM MSACCESS.EXE:3528 QueryKey HKCR\Wow6432Node\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\ProxyStubClsid32 SUCCESS Name: \REGISTRY\MACHINE\SOFTWARE\CLASSES\Wow6432Node\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\ProxyStubClsid32 
    3:44:33 PM MSACCESS.EXE:3528 OpenKey HKCU\Software\Classes\Wow6432Node\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\ProxyStubClsid32 NOT FOUND  
    3:44:33 PM MSACCESS.EXE:3528 QueryValue HKCR\Wow6432Node\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\ProxyStubClsid32\(Default) SUCCESS "{00020424-0000-0000-C000-000000000046}" 
    3:44:33 PM MSACCESS.EXE:3528 CloseKey HKCR\Wow6432Node\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\ProxyStubClsid32 SUCCESS  
    3:44:33 PM ConsoleApplicat:3988 OpenKey HKCU\Software\Classes\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07} NOT FOUND  
    3:44:33 PM ConsoleApplicat:3988 OpenKey HKCR\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07} SUCCESS  
    3:44:33 PM ConsoleApplicat:3988 QueryKey HKCR\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07} SUCCESS Name: \REGISTRY\MACHINE\SOFTWARE\CLASSES\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07} 
    3:44:33 PM ConsoleApplicat:3988 OpenKey HKCU\Software\Classes\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\ProxyStubClsid32 NOT FOUND  
    3:44:33 PM ConsoleApplicat:3988 OpenKey HKCR\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\ProxyStubClsid32 SUCCESS  
    3:44:33 PM ConsoleApplicat:3988 QueryKey HKCR\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\ProxyStubClsid32 SUCCESS Name: \REGISTRY\MACHINE\SOFTWARE\CLASSES\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\ProxyStubClsid32 
    3:44:33 PM ConsoleApplicat:3988 OpenKey HKCU\Software\Classes\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\ProxyStubClsid32 NOT FOUND  
    3:44:33 PM ConsoleApplicat:3988 QueryValue HKCR\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\ProxyStubClsid32\(Default) SUCCESS "{00020424-0000-0000-C000-000000000046}" 
    3:44:33 PM ConsoleApplicat:3988 CloseKey HKCR\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\ProxyStubClsid32 SUCCESS  
    3:44:33 PM ConsoleApplicat:3988 CloseKey HKCR\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07} SUCCESS  
    3:44:33 PM ConsoleApplicat:3988 OpenKey HKCU\Software\Classes\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\ProxyStubClsid32 NOT FOUND  
    3:44:33 PM ConsoleApplicat:3988 OpenKey HKCR\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\ProxyStubClsid32 SUCCESS  
    3:44:33 PM ConsoleApplicat:3988 QueryKey HKCR\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\ProxyStubClsid32 SUCCESS Name: \REGISTRY\MACHINE\SOFTWARE\CLASSES\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\ProxyStubClsid32 
    3:44:33 PM ConsoleApplicat:3988 OpenKey HKCU\Software\Classes\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\ProxyStubClsid32 NOT FOUND  
    3:44:33 PM ConsoleApplicat:3988 QueryValue HKCR\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\ProxyStubClsid32\(Default) SUCCESS "{00020424-0000-0000-C000-000000000046}" 
    3:44:33 PM ConsoleApplicat:3988 QueryKey HKCR\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\ProxyStubClsid32 SUCCESS Name: \REGISTRY\MACHINE\SOFTWARE\CLASSES\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\ProxyStubClsid32 
    3:44:33 PM ConsoleApplicat:3988 OpenKey HKCU\Software\Classes\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\ProxyStubClsid32 NOT FOUND  
    3:44:33 PM ConsoleApplicat:3988 QueryValue HKCR\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\ProxyStubClsid32\(Default) SUCCESS "{00020424-0000-0000-C000-000000000046}" 
    3:44:33 PM ConsoleApplicat:3988 CloseKey HKCR\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\ProxyStubClsid32 SUCCESS  
    3:44:33 PM ConsoleApplicat:3988 OpenKey HKCU\Software\Classes\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\Forward NOT FOUND  
    3:44:33 PM ConsoleApplicat:3988 OpenKey HKCR\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\Forward NOT FOUND  
    3:44:33 PM ConsoleApplicat:3988 OpenKey HKCU\Software\Classes\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\TypeLib NOT FOUND  
    3:44:33 PM ConsoleApplicat:3988 OpenKey HKCR\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\TypeLib SUCCESS  
    3:44:33 PM ConsoleApplicat:3988 QueryKey HKCR\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\TypeLib SUCCESS Name: \REGISTRY\MACHINE\SOFTWARE\CLASSES\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\TypeLib 
    3:44:33 PM ConsoleApplicat:3988 OpenKey HKCU\Software\Classes\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\TypeLib NOT FOUND  
    3:44:33 PM ConsoleApplicat:3988 QueryValue HKCR\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\TypeLib\(Default) SUCCESS "{4AFFC9A0-5F99-101B-AF4E-00AA003F0F07}" 
    3:44:33 PM ConsoleApplicat:3988 QueryKey HKCR\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\TypeLib SUCCESS Name: \REGISTRY\MACHINE\SOFTWARE\CLASSES\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\TypeLib 
    3:44:33 PM ConsoleApplicat:3988 OpenKey HKCU\Software\Classes\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\TypeLib NOT FOUND  
    3:44:33 PM ConsoleApplicat:3988 QueryValue HKCR\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\TypeLib\(Default) SUCCESS "{4AFFC9A0-5F99-101B-AF4E-00AA003F0F07}" 
    3:44:33 PM ConsoleApplicat:3988 QueryKey HKCR\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\TypeLib SUCCESS Name: \REGISTRY\MACHINE\SOFTWARE\CLASSES\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\TypeLib 
    3:44:33 PM ConsoleApplicat:3988 OpenKey HKCU\Software\Classes\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\TypeLib NOT FOUND  
    3:44:33 PM ConsoleApplicat:3988 QueryValue HKCR\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\TypeLib\Version SUCCESS "9.0" 
    3:44:33 PM ConsoleApplicat:3988 QueryKey HKCR\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\TypeLib SUCCESS Name: \REGISTRY\MACHINE\SOFTWARE\CLASSES\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\TypeLib 
    3:44:33 PM ConsoleApplicat:3988 OpenKey HKCU\Software\Classes\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\TypeLib NOT FOUND  
    3:44:33 PM ConsoleApplicat:3988 QueryValue HKCR\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\TypeLib\Version SUCCESS "9.0" 
    3:44:33 PM ConsoleApplicat:3988 CloseKey HKCR\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\TypeLib SUCCESS  
    3:44:33 PM ConsoleApplicat:3988 OpenKey HKCU\Software\Classes\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\Forward NOT FOUND  
    3:44:33 PM ConsoleApplicat:3988 OpenKey HKCR\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\Forward NOT FOUND  
    3:44:33 PM ConsoleApplicat:3988 OpenKey HKCU\Software\Classes\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\TypeLib NOT FOUND  
    3:44:33 PM ConsoleApplicat:3988 OpenKey HKCR\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\TypeLib SUCCESS  
    3:44:33 PM ConsoleApplicat:3988 QueryKey HKCR\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\TypeLib SUCCESS Name: \REGISTRY\MACHINE\SOFTWARE\CLASSES\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\TypeLib 
    3:44:33 PM ConsoleApplicat:3988 OpenKey HKCU\Software\Classes\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\TypeLib NOT FOUND  
    3:44:33 PM ConsoleApplicat:3988 QueryValue HKCR\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\TypeLib\(Default) SUCCESS "{4AFFC9A0-5F99-101B-AF4E-00AA003F0F07}" 
    3:44:33 PM ConsoleApplicat:3988 QueryKey HKCR\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\TypeLib SUCCESS Name: \REGISTRY\MACHINE\SOFTWARE\CLASSES\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\TypeLib 
    3:44:33 PM ConsoleApplicat:3988 OpenKey HKCU\Software\Classes\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\TypeLib NOT FOUND  
    3:44:33 PM ConsoleApplicat:3988 QueryValue HKCR\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\TypeLib\(Default) SUCCESS "{4AFFC9A0-5F99-101B-AF4E-00AA003F0F07}" 
    3:44:33 PM ConsoleApplicat:3988 QueryKey HKCR\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\TypeLib SUCCESS Name: \REGISTRY\MACHINE\SOFTWARE\CLASSES\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\TypeLib 
    3:44:33 PM ConsoleApplicat:3988 OpenKey HKCU\Software\Classes\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\TypeLib NOT FOUND  
    3:44:33 PM ConsoleApplicat:3988 QueryValue HKCR\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\TypeLib\Version SUCCESS "9.0" 
    3:44:33 PM ConsoleApplicat:3988 QueryKey HKCR\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\TypeLib SUCCESS Name: \REGISTRY\MACHINE\SOFTWARE\CLASSES\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\TypeLib 
    3:44:33 PM ConsoleApplicat:3988 OpenKey HKCU\Software\Classes\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\TypeLib NOT FOUND  
    3:44:33 PM ConsoleApplicat:3988 QueryValue HKCR\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\TypeLib\Version SUCCESS "9.0" 
    3:44:33 PM ConsoleApplicat:3988 CloseKey HKCR\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\TypeLib SUCCESS  
    3:44:38 PM ConsoleApplicat:3988 OpenKey HKCU\Software\Classes\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\Forward NOT FOUND  
    3:44:38 PM ConsoleApplicat:3988 OpenKey HKCR\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\Forward NOT FOUND  
    3:44:38 PM ConsoleApplicat:3988 OpenKey HKCU\Software\Classes\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\TypeLib NOT FOUND  
    3:44:38 PM ConsoleApplicat:3988 OpenKey HKCR\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\TypeLib SUCCESS  
    3:44:38 PM ConsoleApplicat:3988 QueryKey HKCR\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\TypeLib SUCCESS Name: \REGISTRY\MACHINE\SOFTWARE\CLASSES\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\TypeLib 
    3:44:38 PM ConsoleApplicat:3988 OpenKey HKCU\Software\Classes\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\TypeLib NOT FOUND  
    3:44:38 PM ConsoleApplicat:3988 QueryValue HKCR\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\TypeLib\(Default) SUCCESS "{4AFFC9A0-5F99-101B-AF4E-00AA003F0F07}" 
    3:44:38 PM ConsoleApplicat:3988 QueryKey HKCR\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\TypeLib SUCCESS Name: \REGISTRY\MACHINE\SOFTWARE\CLASSES\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\TypeLib 
    3:44:38 PM ConsoleApplicat:3988 OpenKey HKCU\Software\Classes\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\TypeLib NOT FOUND  
    3:44:38 PM ConsoleApplicat:3988 QueryValue HKCR\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\TypeLib\(Default) SUCCESS "{4AFFC9A0-5F99-101B-AF4E-00AA003F0F07}" 
    3:44:38 PM ConsoleApplicat:3988 QueryKey HKCR\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\TypeLib SUCCESS Name: \REGISTRY\MACHINE\SOFTWARE\CLASSES\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\TypeLib 
    3:44:38 PM ConsoleApplicat:3988 OpenKey HKCU\Software\Classes\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\TypeLib NOT FOUND  
    3:44:38 PM ConsoleApplicat:3988 QueryValue HKCR\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\TypeLib\Version SUCCESS "9.0" 
    3:44:38 PM ConsoleApplicat:3988 QueryKey HKCR\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\TypeLib SUCCESS Name: \REGISTRY\MACHINE\SOFTWARE\CLASSES\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\TypeLib 
    3:44:38 PM ConsoleApplicat:3988 OpenKey HKCU\Software\Classes\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\TypeLib NOT FOUND  
    3:44:38 PM ConsoleApplicat:3988 QueryValue HKCR\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\TypeLib\Version SUCCESS "9.0" 
    3:44:38 PM ConsoleApplicat:3988 CloseKey HKCR\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\TypeLib SUCCESS  
    3:44:38 PM ConsoleApplicat:3988 OpenKey HKCU\Software\Classes\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\Forward NOT FOUND  
    3:44:38 PM ConsoleApplicat:3988 OpenKey HKCR\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\Forward NOT FOUND  
    3:44:38 PM ConsoleApplicat:3988 OpenKey HKCU\Software\Classes\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\TypeLib NOT FOUND  
    3:44:38 PM ConsoleApplicat:3988 OpenKey HKCR\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\TypeLib SUCCESS  
    3:44:38 PM ConsoleApplicat:3988 QueryKey HKCR\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\TypeLib SUCCESS Name: \REGISTRY\MACHINE\SOFTWARE\CLASSES\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\TypeLib 
    3:44:38 PM ConsoleApplicat:3988 OpenKey HKCU\Software\Classes\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\TypeLib NOT FOUND  
    3:44:38 PM ConsoleApplicat:3988 QueryValue HKCR\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\TypeLib\(Default) SUCCESS "{4AFFC9A0-5F99-101B-AF4E-00AA003F0F07}" 
    3:44:38 PM ConsoleApplicat:3988 QueryKey HKCR\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\TypeLib SUCCESS Name: \REGISTRY\MACHINE\SOFTWARE\CLASSES\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\TypeLib 
    3:44:38 PM ConsoleApplicat:3988 OpenKey HKCU\Software\Classes\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\TypeLib NOT FOUND  
    3:44:38 PM ConsoleApplicat:3988 QueryValue HKCR\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\TypeLib\(Default) SUCCESS "{4AFFC9A0-5F99-101B-AF4E-00AA003F0F07}" 
    3:44:38 PM ConsoleApplicat:3988 QueryKey HKCR\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\TypeLib SUCCESS Name: \REGISTRY\MACHINE\SOFTWARE\CLASSES\Interface\{68CCE6C0-6129-101B-AF4E-00AA003F0F07}\TypeLib 

    Wednesday, February 21, 2007 9:33 PM
  • asdffgh,

    Could you tell me the target of your project? What is the next step you want to do?

    Tuesday, February 27, 2007 8:55 AM
  • Hi Bruno Yu,

    I am just trying to do some automation using MS Access and Excel. I use to do it using VB 6. Now I want to do it using VB .net and having trouble.

     

    asdffgh

     

    Thursday, March 1, 2007 1:38 PM
  • asdffgh,

    Thank you for your reply and sorry for my delay. Please read the following article and hope that can help you with the problem:

    Calling Visual Basic for Applications Code from Visual Basic .NET

    http://msdn2.microsoft.com/en-us/library/aa159913(office.11).aspx

    Using automation and COM Interop to combine the capabilities of Microsoft Visual Basic .NET applications with those of Microsoft Visual Basic for Applications (VBA) provides a convenient way to create solutions using the best of both. In this article, learn how to run VBA procedures in key Microsoft Office programs directly from Visual Basic .NET.

    Wednesday, March 7, 2007 7:01 AM
  • I know this is an old thread, but I'm getting the same error:

     

    Unable to cast COM object of type 'Microsoft.Office.Interop.Access.ApplicationClass' to interface type 'Microsoft.Office.Interop.Access._Application'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{68CCE6C0-6129-101B-AF4E-00AA003F0F07}' failed due to the following error: Error loading type library/DLL. (Exception from HRESULT: 0x80029C4A (TYPE_E_CANTLOADLIBRARY)).

     

    Even using the example code you provided in the link above, I still get the error.

     

    It's something specific to my machine (and "asdffgh's" machine). I can run the compiled EXE on another machine and it works fine.

     

    I'm going to try to do a repair on my Office installation to see if that works, but if anyone has any ideas, I'd sure appreciate it.

     

    Thanks.

     

    David

    Monday, April 28, 2008 4:21 PM
  • Reinstalled Office, problem persisted.

     

    Problem is on Vista x64 (pre-SP1) machine with Office 2007 Ultimate.

    Code runs fine on Windows 2003 Server x86 machine with Office 2007 Enterprise.

     

    So at this point, I'm thinking it's either a Vista or x64 issue (or both).

     

    Problem Solved: It's an x64 issue. I went into "My Project", clicked the Compile tab, clicked the "Advanced Compile Options..." and chose "x86" for Target CPU. Now the code runs fine.

     

    So apparently, you can't do office automation (or at least Access) from an "AnyCPU" (or x64) targeted .NET compiled EXE.

     

    David

    Monday, April 28, 2008 6:07 PM
  • I had the same problem. This for v studio 2008, Ms office 2002, with PIA interop for applications installed.
    The following solves the problems

    Instead of declaring the office objects, for example excel as following

    Dim oExcel As New Excel.Application()

    use

     
    Dim oExcel As Object
    Set oExcel = CreateObject("Excel.Application")


    Also instead of using Excel.attributes in setting sheet attributes
    use Microsoft.Office.Interop.Excel.attributes

    Thanks
    suresh
    • Proposed as answer by skumar111 Tuesday, August 25, 2009 5:13 PM
    • Edited by skumar111 Tuesday, August 25, 2009 5:29 PM
    Tuesday, August 25, 2009 5:12 PM
  • I ran into a similar issue as well, but I think there is a bug in the MS DLL.  The bug went away when I set the compiler to build for x86 applications only. 
    Tuesday, January 26, 2010 6:33 PM
  • Reinstalled Office, problem persisted.

     

    Problem is on Vista x64 (pre-SP1) machine with Office 2007 Ultimate.

    Code runs fine on Windows 2003 Server x86 machine with Office 2007 Enterprise.

     

    So at this point, I'm thinking it's either a Vista or x64 issue (or both).

     

    Problem Solved: It's an x64 issue. I went into "My Project", clicked the Compile tab, clicked the "Advanced Compile Options..." and chose "x86" for Target CPU. Now the code runs fine.

     

    So apparently, you can't do office automation (or at least Access) from an "AnyCPU" (or x64) targeted .NET compiled EXE.

     

    David

    I tried the same thing as well, changing my project build target from "Any CPU" to x86 and I'm still getting an error (though it's another cryptic one that I can't solve). Now the error is: "Attempted to read or write protected memory. This is often an indication that other memory is corrupt." Either/both exceptions happen on the line in my code where I try to open an Access database:

    AccessApp.OpenCurrentDatabase(mdbPath.FullName, Exclusive: false);

    Different databases don't matter, whether it's Exclusive or not doesn't matter, etc. I have a feeling it's because of some missing software on the server I'm running this on, as it works fine on my development machine, but I don't know. Additionally, I can't make my project's targeted framework lower than .NET 4.0 because my app relies on libraries that are 4.0+. Damnit.

    Monday, September 19, 2016 6:13 PM