0x80029C4A (TYPE_E_CANTLOADLIBRARY)

After installing my application (the installation log looks fine), a particular client (US Military) received the following error when trying to start my application:
System.InvalidCastException: Unable to cast COM object of type 'Microsoft.Office.Interop.Word.ApplicationClass' to interface type 'Microsoft.Office.Interop.Word._Application'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{00020970-0000-0000-C000-000000000046}' failed due to the following error: Error loading type library/DLL. (Exception from HRESULT: 0x80029C4A (TYPE_E_CANTLOADLIBRARY)).
Based on other responses I have read on this error, it looks like the registry may be corrupted by Anti-virus script blocking software or by multiple instances of Office installed.  Indeed the client is running the Symantec software. Are there other causes I should be aware of?
Is there something my code can do to get around this?  I don’t want to have them reinstall Office, as to them it is working fine (i.e. they can start Word and Outlook manually just fine).

Hi Guys!
I've been struggling with a similar problem for about 3 days solid now, and finally after an intense amount of googling and lots of trial and error, I have managed to solve it, I hope the same solution can be applied to your problems.
First off, some basic background info. This problem arose for me after uninstalling Office 2007 and going back to Office 2003 due to the Office 2007 PIA's not being able to communicate correctly and provide backwards compatibility with Office 2003. Upon reinstallation none of my COM calls to any Office COM DLL would work, every call would return the error that is mentioned in the post i.e. CANTLOADLIBRARY, with a long CLSID number e.g. {A5EDEDF4-2BBC-45F3-822B-E60C278A1A79}. I deduced that this must have been due to Office 2007 leaving a bad trail of uninstalled registry key entries...
This CLSID is the key to solving the problem.
First off copy the CLSID from the error window that appears in VB.NET. Access the registry via Start, Run, Cmd, RegEdt32, enter. Once the registry editor loads up, do a search (ctrl F3) on that specific CLSID (I didn't include the braces, but it shouldn't matter). The registry should find a key located under the HKEY_CLASSES_ROOT -> CLSID subkey. Expand this key and you should see 3 nodes: ProxyStubCLSID,ProxyStubCLSID32 and the important one - TypeLib. Essentially what is happening is that when you make the COM call to a specific Office assembly. The assembly opens up the registry and finds this key which gives it the CLSID of the TypeLib it must call in order to initiate a call to the COM.
Under the TypeLib key copy the (Default) Entry (It should be another long CSLID key). Now the easiest way to find this new key entry relating to the CLSID, is to go back up to the root key, HKEY_CLASSES_ROOT and look for the TypeLib subkey. I did this by simply pushing "T" on the keyboard till I got to the all the "T's" on the level below the HKEY root. Once you find this key, highlight the key and do a search (Ctrl F3) from this key for the TypeLib CLSID that you copied earlier. Once you find it, expand it and see if there are multiple versions of the typelib i.e. 8.3, 8.4, 8.5. You want to eliminate the the later versions that are pointing to non-existant TypeLib's. To do this, expand the Version key (ie. 8.3), then expand the "0" key, then the win32 key and check the value of the default entry. This value should be a file path. Mine was pointing to a tlb file in an Office12 directory (Office 2007), that obviously didn't exist since I uninstalled 2007. Simply delete this key, and now when the COM interface attempts to locate the latest TypeLib it will find one that does indeed exist, and will hopefully run error free. Well at least it did for me.
Hope this solves some of your guys problems.
Cheers!

Similar Messages

  • A Critical Error on Search Service 2013

    So simply, one of our clients had an issue on an SP machine and decided to do a Bare Metal Restore on the OS Drive (Bad, Bad Idea). that has now created a whole host of issues on that SP box. The main issue that i've got left to fix are, Search Service /
    UPS.  On the box the services show as being started but in CA trying to do anything with them you get the error bellow.
    The Errors that are in the log: 
    The Execute method of job definition Microsoft.Office.Server.Search.Administration.IndexingScheduleJobDefinition (ID b65d25b3-66d7-420f-8227-1e36c0e3ff87) threw an exception. More information is included below. Unable to cast COM object of type 'Microsoft.Office.Server.Search.Administration.MSSITLB.CGatheringManagerClass' to interface type 'Microsoft.Office.Server.Search.Administration.MSSITLB.IGatherManagerAdmin3'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{0FF1CE15-013A-0000-0000-000000000000}' failed due to the following error: Error loading type library/DLL. (Exception from HRESULT: 0x80029C4A (TYPE_E_CANTLOADLIBRARY)).
    The Execute method of job definition Microsoft.Office.Server.UserProfiles.UserProfileImportJob (ID dc96957b-4fd6-46bc-9356-67bc83c66722) threw an exception. More information is included below. There was no endpoint listening at http://sp2013:5725/ResourceManagementService/MEX that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.
    Any idea's are welcome, on a side note deleting the service and re-setting it up doesn't achieve any different results.
    Ben

    I'm guessing you set this admin account as your Search Service and App Pool account as well?
    If you go into Central Admin - Security - Service Accounts, can you change your account for Windows Service SharePoint Server Search, and also (if applicable) Service Application Pool - whatver your search is.
    If this helped you resolve your issue, please mark it Answered. You can reach me through http://itfreesupport.com/

  • Office Automation App Fails On Office 365 Machines

    I have an application that does COM automation with Excel.  I use Microsoft.Office.Interop.Excel from C#.
    The application works fine if Office 2010 is installed.  On machines with Office 365 installed, I get the following error:
    System.InvalidCastException: Unable to cast COM object of type 'System.__ComObject' to interface type 'Microsoft.Office.Interop.Excel.Application'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{000208D5-0000-0000-C000-000000000046}'
    failed due to the following error: Error loading type library/DLL. (Exception from HRESULT: 0x80029C4A (TYPE_E_CANTLOADLIBRARY)).
    Code is trivial to reproduce:
    using System;
    using System.Collections.Generic;
    using System.Data;
    using System.Diagnostics;
    using System.IO;
    using System.Runtime.InteropServices;
    using System.Text;
    using System.Threading;
    using Excel = Microsoft.Office.Interop.Excel;
    namespace TestExcel
        class Program
            static void Main(string[] args)
                // Start Excel and get Application object.
                Excel.Application excelApp = new Excel.Application(); // Fails here
                // Set some properties.
                excelApp.Visible = false;
                excelApp.DisplayAlerts = false;
                excelApp.Quit();
                Marshal.ReleaseComObject(excelApp);
    Any ideas how to fix this?
    Matt
    Matt

    Hi Matt.
    Which version of COM do you reference?
    If you reference version 15.0 in your application, I recommend that you could try this way:
    1.Delete the Excel reference (Microsoft.Office.Interop.Excel). Version 15.0.
    2.Add the Excel reference (older one. Version 14.0).
    Hope that helps.
    If your application still causes this error, please let me know.
    Thanks.
    George Hua
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

  • Error in Search after restore from backup

    We recently had to restore our Sharepoint 2010 Enterprise farm from backup due to a failed attempt to move the SharePoint DB's to a new SQL server and now our search service is no longer working.  It had been working fine before the restore mind you. 
    I took the recommended action of removing the search service (and related DB's) and adding a new one via Central Admin but that simply results in another broken service that won't work.  I thought that perhaps running the Powershell script listed here
    might help narrow down the problem:
    http://blogs.msdn.com/b/russmax/archive/2009/10/20/sharepoint-2010-configuring-search-service-application-using-powershell.aspx
    I assumed this would allow me to see where the process is failing.  So after updating the variables to meet our environment, here's the step that fails:
    $SSI = get-spenterprisesearchserviceinstance -local
    Start-SPEnterpriseSearchServiceInstance -Identity $SSI
    The error is as follows:
    Start-SPEnterpriseSearchServiceInstance : Unable to cast COM object of type "Microsoft.Office.Server.Search.Administration.MSSITLB.CGatheringManagerClass' to interface type 'Microsoft.Office.Server.Search.Administration.MSSITLB.IGatherManagerAdmin3'. This
    operation failed because the QueryInterface call on the COM component for the interface with IID '{0FF1CE14-013A-0000-0000-000000000000}' failed due to the following error: Error loading type library/DLL. (Exception from HRESULT: 0x80029C4A (TYPE_E_CANTLOADLIBRARY)).
    I can't seem to find resolution to this error via Google.  Anyone have any thoughts?

    Hi mbrowning01,
    The issue may be caused by the permissions problem.  When you open the PowerShell command, please make sure you “run as administrator”.
    SharePoint 2010 Management Shell must be launched with elevated administrative permission by selecting Run as administrator.
    http://technet.microsoft.com/en-us/library/ee806878.aspx
    share your result.
    Wayne Fan
    TechNet Community Support

  • Accesing Outlook 2010/2013 contacts

    Hi,
    Currently I am trying to access the contacts of Outlook 2010 and 2013. It works fine for most parts but on some PC's I am getting this error:
    System.InvalidCastException: Das COM-Objekt des Typs "Microsoft.Office.Interop.Outlook.ApplicationClass" kann nicht in den Schnittstellentyp "Microsoft.Office.Interop.Outlook._Application" umgewandelt werden. Dieser Vorgang konnte nicht durchgeführt werden, da der QueryInterface-Aufruf an die COM-Komponente für die Schnittstelle mit der IID "{00063001-0000-0000-C000-000000000046}" aufgrund des folgenden Fehlers nicht durchgeführt werden konnte: Fehler beim Laden der Typbibliothek/DLL. (Ausnahme von HRESULT: 0x80029C4A (TYPE_E_CANTLOADLIBRARY)).
    bei System.StubHelpers.StubHelpers.GetCOMIPFromRCW(Object objSrc, IntPtr pCPCMD, IntPtr& ppTarget, Boolean& pfNeedsRelease)
    bei Microsoft.Office.Interop.Outlook.ApplicationClass.get_Session()
    bei SKMailDatentransfer.frmMain.frmMain_Load(Object sender, EventArgs e)
    bei System.EventHandler.Invoke(Object sender, EventArgs e)
    bei System.Windows.Forms.Form.OnLoad(EventArgs e)
    bei System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
    bei System.Windows.Forms.Control.CreateControl()
    bei System.Windows.Forms.Control.WmShowWindow(Message& m)
    bei System.Windows.Forms.Control.WndProc(Message& m)
    bei System.Windows.Forms.Form.WndProc(Message& m)
    bei System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
    This is happening in this part of my code:
    Dim outlookApplication = New Microsoft.Office.Interop.Outlook.Application()
    Dim contacts As MAPIFolder = outlookApplication.GetNamespace("mapi").GetDefaultFolder(OlDefaultFolders.olFolderContacts)
    For i As Integer = 1 To contacts.Items.Count
    Dim contact = DirectCast(contacts.Items(i), ContactItem)
    cboEmail.Items.Add(contact.Email1Address)
    Next
    I am getting this error on a PC with Outlook 2010. But it works on some other Outlook 2010 PC's..
    Thanks

    Hello Otto,
    Do you have the Click2Run edition of Office 2010 installed on the problematic PC? 
    The Click2Run edition of Office 2010 doesn't support automation. See Office
    2010 Click-to-Run compatibility with add-ins for more information. Also you may find the How
    to: Verify Whether Outlook Is a Click-to-Run Application on a Computer article.

  • Regarding B1DE 2004

    Hi,
    Here I am having SAP Business One 2005 B & .Net 2005 installed on my system.
    When I installed B1DE 2004 on my system i am unable to use the object SAPbouiCOM for applications which i have already executed.  
    I am getting the Errors as
            Cannot load type library for reference "SAPbouiCOM". Error loading type library/DLL. (Exception from HRESULT: 0x80029C4A (TYPE_E_CANTLOADLIBRARY))     
    creating form UI The referenced component 'SAPbouiCOM' could not be found.
    Is it possible to use B1DE 2004 with SAP B1 2005B.
    What is the remedy for this.
    Can anybody give me the solution.
    Thanks
    Saritha

    Saritha,
    Unless I am misunderstanding the problem you are having, you cannot mix the version of B1DE and the version of SAP Business One.  In your post you state that you are using SAP Business One 2005 and VS.Net 2005 and B1DE for version 2004 of SAP Business One.  You need to download the correct version of B1DE for the version of Business One and the version of VS that you are using from this link...
    https://www.sdn.sap.com/irj/sdn/businessone?rid=/webcontent/uuid/a175fb62-0c01-0010-a8b5-fa58a13b1cf7 [original link is broken]
    Eddy

  • Default content access account all errors

    After renamed the drive SharePoint Server 2010 working well but when you go in Search service and click on Content sources we are
    getting below error.
    Unable to cast COM object of type 'Microsoft.Office.Server.Search.Administration.MSSITLB.CGatheringManagerClass' to interface type 'Microsoft.Office.Server.Search.Administration.MSSITLB.IGatherManagerAdmin3'.
    This operation failed because the QueryInterface call on the COM component for the interface with IID '{0FF1CE14-013A-0000-0000-000000000000}' failed due to the following error: Error loading type library/DLL. (Exception from HRESULT: 0x80029C4A (TYPE_E_CANTLOADLIBRARY)).

    Hi Giri,
    Sorry to ask so many questions, but what about (basic) site search? Is this working?
    For example if you go to a specific site or document library can you search and at least get results back for that site or library? Or is the search full stop not working..?
    To begin with I would try running the following powershell script using SharePoint 2010 Management Shell
    $SSI = get-spenterprisesearchserviceinstance -local
    Start-SPEnterpriseSearchServiceInstance -Identity $SSI
    The first line gets the name of your enterprise search service instance and sets the variable $SSI to = it
    The second line then attempts to start the enterprise search service instance using the variable (which was set in the first line)
    Hopefully this should at get things working if the instance service is just down or at least help us narrow things down
    *Dont forget to launch Sharepoint Management Shell with elevated administrative permission.
    (Via Start > All programs > Sharepoint 2010 Products > Right Click Sharepoint 2010 Management Shell > select Run as administrator)
    Let me know how well you get on with this...
    TechieMark

  • Nuget is busted (for me)

    When I select Load Tools | Library Package Manager | Manage NuGet Packages for Solution, it comes up with Onlilne | NuGet official package source selected, I see this err msg in the middle pane:
    Unable to cast COM object of type 'System.__ComObject' to interface type 'EnvDTE.DTE'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{04A72314-32E9-48E2-9B87-A63603454F3E}' failed due to the following
    error: Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED)).
    Similarly, perhaps, my project's Output shows: Could not parse the configuration file. The error message is: 'Error loading type library/DLL. (Exception from HRESULT: 0x80029C4A (TYPE_E_CANTLOADLIBRARY))'. Try editing the file manually and then saving it.
    What configuration file is it talking about? Web.config? I see nothing unusual in it...

    The error message says that a plugin wants to use a version of Visual Studio core automation API which is not installed or registered as a COM object. I would try install the latest Visual Studio updates, then maybe reinstall the nuget plugin.
    If it doesn't work create a copy of everything in the .nuget folder. Then
    delete the .nuget folder, close the solution and open it again. Right click on the enable nuget package restore. This will create a new .nuget folder with new .config, targets and exe files. Hopefully it will work after that. 

  • Unable to create Search Service Application

    Hi All,
    When I tried to create Search Service Application in Central Admin, I'm getting Error on creation. The below is the detail error.
    Errors were encountered during the configuration of the Search Service Application.
    Microsoft.SharePoint.SPException: The timer job completed, but failed on one or more machines in the farm. at Microsoft.SharePoint.Administration.SPTimerJobAsyncResult.End()
    at Microsoft.SharePoint.Administration.SPServiceApplication.ProvisionInstances() at Microsoft.SharePoint.Administration.SPIisWebServiceApplication.Provision() at Microsoft.Office.Server.Search.Administration.SearchServiceApplication.Provision() at Microsoft.Office.Server.Search.Administration.SearchConfigWizard.b__22()
    at Microsoft.Office.Server.Search.Administration.SearchAdminUtils.UpdateIgnoreSPUpdatedConcurrencyException(String description, SearchAdminUtilsUpdateDelegate updateDelegate, SearchAdminUtilsRefreshObjectDelegate refreshObjectDelegate) at Microsoft.Office.Server.Search.Administration.SearchConfigWizard.CreateSearchApp()
    at Microsoft.Office.Server.Search.Administration.SearchConfigWizard.ProvisionSearchServiceApplication() at Microsoft.Office.Server.Search.Administration.SearchConfigurationJobDefinition.ExecuteTimerJob()
    5/2/2011 11:49:08 AM
    Could any body guide, where I'm missing?.
    Thanks
    When I looked in EventViewer for more error details, the below is the error message.
    Access to 'Global\Microsoft.SharePoint.SPIisProvisioningLock' is denied
    any ideas?.

    It doesnt work.
    I Stopped the search service and then try to receate the Search sercie application with the gui. In the log I get the same error.
    SearchConfigWizardFinish page failed with exception. System.InvalidCastException: Unable to cast COM object of type 'Microsoft.Office.Server.Search.Administration.MSSITLB.CGatheringManagerClass' to interface type 'Microsoft.Office.Server.Search.Administration.MSSITLB.IGatherManagerAdmin3'.
    This operation failed because the QueryInterface call on the COM component for the interface with IID '{0FF1CE14-013A-0000-0000-000000000000}' failed due to the following error: Error loading type library/DLL. (Exception from HRESULT: 0x80029C4A (TYPE_E_CANTLOADLIBRARY)).   
    Server stack trace:      at Microsoft.Office.Server.Search.Administration.Gatherer.get_AdminObject()     at Microsoft.Office.Server.Search.Administration.Gatherer.ProvisionGlobalProperties()    
    at Microsoft.Office.Server.Search.Administration.Gatherer.Provision()     at Microsoft.Office.Server.Search.Administration.SearchServiceInstance.Provision()     at Microsoft.Office.Server.Search.Administration.SearchAdminUtils.DeployLocalServiceInstance[T](T
    localSearchServiceInstance)     at Microsoft.Office.Server.Search.Administration.SearchConfigurationJobDefinition.Create(AbstractSearchConfigWizard wizardOM)     at Microsoft.Office.Server.Search.Internal.UI.SearchConfigWizardFinish.ExecuteConfigurationTimerJob(SPLongOperationState
    longOperationState, String& strRedirectPage)     at Microsoft.SharePoint.SPStatefulLongOperation.SetThreadCultureAndRun(RunStatefulOperation runOperation, SPLongOperationState state, CultureInfo culture, CultureInfo uICulture)    
    at Microsoft.SharePoint.SPStatefulLongOperation.<>c__DisplayClass6.<Run>b__0(Object state)     at Microsoft.SharePoint.Utilities.SPThreadPool.WaitCallbackWrapper(Object state)     at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr
    md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)     at System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(IMessage msg, IMessageSink replySink)    Exception
    rethrown at [0]:      at System.Runtime.Remoting.Proxies.RealProxy.EndInvokeHelper(Message reqMsg, Boolean bProxyCase)     at System.Runtime.Remoting.Proxies.RemotingProxy.Invoke(Object NotUsed, MessageData&
    msgData)     at System.Threading.WaitCallback.EndInvoke(IAsyncResult result)     at Microsoft.SharePoint.Utilities.SPThreadPool.RunAsyncWorkItem(ImpersonatedCallbackParam param, TimerCallback timerCallback, Object timerState,
    Int32 timerPeriod)     at Microsoft.SharePoint.Utilities.SPThreadPool.RunAsyncWorkItemWithImpersonation(WaitCallback workItemCallback, Object workItemState, TimerCallback timerCallback, Object timerState, Int32 timerPeriod)    
    at Microsoft.SharePoint.SPStatefulLongOperation.Run(RunStatefulOperation runOperation)     at Microsoft.Office.Server.Search.Internal.UI.SearchConfigWizardFinish.<>c__DisplayClass2.<Commit>b__0(SPStatefulLongOperation longOperation)

  • Unable to create a search service

    When I try to create a new search service I get:
    SearchConfigWizardFinish page failed with exception. System.InvalidCastException: Unable to cast COM object of type 'Microsoft.Office.Server.Search.Administration.MSSITLB.CGatheringManagerClass' to interface type 'Microsoft.Office.Server.Search.Administration.MSSITLB.IGatherManagerAdmin3'.
    This operation failed because the QueryInterface call on the COM component for the interface with IID '{0FF1CE14-013A-0000-0000-000000000000}' failed due to the following error: Error loading type library/DLL. (Exception from HRESULT: 0x80029C4A (TYPE_E_CANTLOADLIBRARY)).   
    Server stack trace:      at Microsoft.Office.Server.Search.Administration.Gatherer.get_AdminObject()     at Microsoft.Office.Server.Search.Administration.Gatherer.ProvisionGlobalProperties()    
    at Microsoft.Office.Server.Search.Administration.Gatherer.Provision()     at Microsoft.Office.Server.Search.Administration.SearchServiceInstance.Provision()     at Microsoft.Office.Server.Search.Administration.SearchAdminUtils.DeployLocalServiceInstance[T](T
    localSearchServiceInstance)     at Microsoft.Office.Server.Search.Administration.SearchConfigurationJobDefinition.Create(AbstractSearchConfigWizard wizardOM)     at Microsoft.Office.Server.Search.Internal.UI.SearchConfigWizardFinish.ExecuteConfigurationTimerJob(SPLongOperationState
    longOperationState, String& strRedirectPage)     at Microsoft.SharePoint.SPStatefulLongOperation.SetThreadCultureAndRun(RunStatefulOperation runOperation, SPLongOperationState state, CultureInfo culture, CultureInfo uICulture)    
    at Microsoft.SharePoint.SPStatefulLongOperation.<>c__DisplayClass6.<Run>b__0(Object state)     at Microsoft.SharePoint.Utilities.SPThreadPool.WaitCallbackWrapper(Object state)     at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr
    md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)     at System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(IMessage msg, IMessageSink replySink)    Exception
    rethrown at [0]:      at System.Runtime.Remoting.Proxies.RealProxy.EndInvokeHelper(Message reqMsg, Boolean bProxyCase)     at System.Runtime.Remoting.Proxies.RemotingProxy.Invoke(Object NotUsed, MessageData&
    msgData)     at System.Threading.WaitCallback.EndInvoke(IAsyncResult result)     at Microsoft.SharePoint.Utilities.SPThreadPool.RunAsyncWorkItem(ImpersonatedCallbackParam param, TimerCallback timerCallback, Object timerState,
    Int32 timerPeriod)     at Microsoft.SharePoint.Utilities.SPThreadPool.RunAsyncWorkItemWithImpersonation(WaitCallback workItemCallback, Object workItemState, TimerCallback timerCallback, Object timerState, Int32 timerPeriod)    
    at Microsoft.SharePoint.SPStatefulLongOperation.Run(RunStatefulOperation runOperation)     at Microsoft.Office.Server.Search.Internal.UI.SearchConfigWizardFinish.<>c__DisplayClass2.<Commit>b__0(SPStatefulLongOperation longOperation)

    Hi,
    According to your error message, it can be caused by the default content access account do not  have READ permissions to the GAC on the local SharePoint server.
    For your issue, please give the  account permissions to the local GAC on the SharePoint server. You can use the cacls.exe command line utility:
    cacls.exe %windir%/assembly /e /t /p DOMAIN\AccountName
    Reference:
    http://blogs.msdn.com/b/miah/archive/2008/07/15/specifying-global-assembly-cache-permissions.aspx
    Best Regards,
    Eric
    Eric Tao
    TechNet Community Support

  • Basic excel script: HELP

    I want a script to write to excel. But when I start with the basic it won't work.
    I'm running this on Win7.
    I have looked for hours, and tried diffrend commands, but result is always the same.
    Can't write to cell and can't save excel file.
    Script:
    $xl=New-Object -ComObject Excel.Application
    $wb=$xl.Workbooks.Add
    $ws=$wb.ActiveWorkbook
    $cells=$ws.Cells
    $cells.Item(1,1).Value() = 'x' 
    #$ws.cells.Item(1,1).Value() = "x" 
    $xlWorkbookNormal = -4143 
    $wb.SaveAs("H:\xlstest.xlsx", $xlWorkbookNormal )
    $wb.close
    $xl.quit
    Errors:
    You cannot call a method on a null-valued expression.
    At H:\_Algemeen\_Software\_MijnBeheersScript\excel.ps1:6 char:12
    + $cells.Item <<<< (1,1).Value() = 'x' 
        + CategoryInfo          : InvalidOperation: (Item:String) [], RuntimeException
        + FullyQualifiedErrorId : InvokeMethodOnNull
    You cannot call a method on a null-valued expression.
    At H:\_Algemeen\_Software\_MijnBeheersScript\excel.ps1:10 char:11
    + $wb.SaveAs <<<< ("H:\xlstest.xlsx", $xlWorkbookNormal )
        + CategoryInfo          : InvalidOperation: (SaveAs:String) [], RuntimeException
        + FullyQualifiedErrorId : InvokeMethodOnNull

    Hey Mario,
    If I run your script, these are the errors:
    GAC    Version        Location                       
    True   v2.0.50727     C:\Windows\assembly\GAC_MSIL...
    Exception setting "DisplayAlerts": "Unable to cast CO
    M object of type 'Microsoft.Office.Interop.Excel.Appl
    icationClass' to interface type 'Microsoft.Office.Int
    erop.Excel._Application'. This operation failed becau
    se the QueryInterface call on the COM component for t
    he interface with IID '{000208D5-0000-0000-C000-00000
    0000046}' failed due to the following error: Error lo
    ading type library/DLL. (Exception from HRESULT: 0x80
    029C4A (TYPE_E_CANTLOADLIBRARY))."
    At C:\Users\Esther\AppData\Local\Temp\3c953d24-3672-4
    c0f-bd8b-6bc7a30b0d23.ps1:6 char:8
    + $Excel. <<<< DisplayAlerts = $false
        + CategoryInfo          : InvalidOperation: (:)  
       [], RuntimeException
        + FullyQualifiedErrorId : PropertyAssignmentExce 
       ption
    You cannot call a method on a null-valued expression.
    At C:\Users\Esther\AppData\Local\Temp\3c953d24-3672-4
    c0f-bd8b-6bc7a30b0d23.ps1:9 char:33
    + $Workbook = $Excel.Workbooks.Add <<<< () 
        + CategoryInfo          : InvalidOperation: (Add 
       :String) [], RuntimeException
        + FullyQualifiedErrorId : InvokeMethodOnNull
    You cannot call a method on a null-valued expression.
    At C:\Users\Esther\AppData\Local\Temp\3c953d24-3672-4
    c0f-bd8b-6bc7a30b0d23.ps1:12 char:39
    + $Worksheet = $Workbook.Worksheets.Item <<<< (1)
        + CategoryInfo          : InvalidOperation: (Ite 
       m:String) [], RuntimeException
        + FullyQualifiedErrorId : InvokeMethodOnNull
    You cannot call a method on a null-valued expression.
    At C:\Users\Esther\AppData\Local\Temp\3c953d24-3672-4
    c0f-bd8b-6bc7a30b0d23.ps1:15 char:18
    + $Excel.Cells.Item <<<< (1,1).Value2 =("UserName")
        + CategoryInfo          : InvalidOperation: (Ite 
       m:String) [], RuntimeException
        + FullyQualifiedErrorId : InvokeMethodOnNull
    You cannot call a method on a null-valued expression.
    At C:\Users\Esther\AppData\Local\Temp\3c953d24-3672-4
    c0f-bd8b-6bc7a30b0d23.ps1:16 char:18
    + $Excel.Cells.Item <<<< (1,2).Value2 = ("Path")
        + CategoryInfo          : InvalidOperation: (Ite 
       m:String) [], RuntimeException
        + FullyQualifiedErrorId : InvokeMethodOnNull
    You cannot call a method on a null-valued expression.
    At C:\Users\Esther\AppData\Local\Temp\3c953d24-3672-4
    c0f-bd8b-6bc7a30b0d23.ps1:17 char:18
    + $Excel.Cells.Item <<<< (1,3).Value2 = ("Date")
        + CategoryInfo          : InvalidOperation: (Ite 
       m:String) [], RuntimeException
        + FullyQualifiedErrorId : InvokeMethodOnNull
    The term 'Get-Openfiles' is not recognized as the nam
    e of a cmdlet, function, script file, or operable pro
    gram. Check the spelling of the name, or if a path wa
    s included, verify that the path is correct and try a
    gain.
    At C:\Users\Esther\AppData\Local\Temp\3c953d24-3672-4
    c0f-bd8b-6bc7a30b0d23.ps1:27 char:14
    + Get-Openfiles <<<<  | % { 
        + CategoryInfo          : ObjectNotFound: (Get-O 
       penfiles:String) [], CommandNotFoundException
        + FullyQualifiedErrorId : CommandNotFoundExcepti 
       on
    You cannot call a method on a null-valued expression.
    At C:\Users\Esther\AppData\Local\Temp\3c953d24-3672-4
    c0f-bd8b-6bc7a30b0d23.ps1:41 char:18
    + $Worksheet.SaveAs <<<< ($LogPath)
        + CategoryInfo          : InvalidOperation: (Sav 
       eAs:String) [], RuntimeException
        + FullyQualifiedErrorId : InvokeMethodOnNull
    Exception setting "Visible": "Unable to cast COM obje
    ct of type 'Microsoft.Office.Interop.Excel.Applicatio
    nClass' to interface type 'Microsoft.Office.Interop.E
    xcel._Application'. This operation failed because the
     QueryInterface call on the COM component for the int
    erface with IID '{000208D5-0000-0000-C000-00000000004
    6}' failed due to the following error: Error loading 
    type library/DLL. (Exception from HRESULT: 0x80029C4A
     (TYPE_E_CANTLOADLIBRARY))."
    At C:\Users\Esther\AppData\Local\Temp\3c953d24-3672-4
    c0f-bd8b-6bc7a30b0d23.ps1:44 char:8
    + $Excel. <<<< Visible = $false
        + CategoryInfo          : InvalidOperation: (:)  
       [], RuntimeException
        + FullyQualifiedErrorId : PropertyAssignmentExce 
       ption
    You cannot call a method on a null-valued expression.
    At C:\Users\Esther\AppData\Local\Temp\3c953d24-3672-4
    c0f-bd8b-6bc7a30b0d23.ps1:48 char:28
    + $range.EntireColumn.AutoFit <<<< ()
        + CategoryInfo          : InvalidOperation: (Aut 
       oFit:String) [], RuntimeException
        + FullyQualifiedErrorId : InvokeMethodOnNull
    Exception calling "Quit" with "0" argument(s): "Unabl
    e to cast COM object of type 'Microsoft.Office.Intero
    p.Excel.ApplicationClass' to interface type 'Microsof
    t.Office.Interop.Excel._Application'. This operation 
    failed because the QueryInterface call on the COM com
    ponent for the interface with IID '{000208D5-0000-000
    0-C000-000000000046}' failed due to the following err
    or: Error loading type library/DLL. (Exception from H
    RESULT: 0x80029C4A (TYPE_E_CANTLOADLIBRARY))."
    At C:\Users\Esther\AppData\Local\Temp\3c953d24-3672-4
    c0f-bd8b-6bc7a30b0d23.ps1:51 char:12
    + $Excel.Quit <<<< () 
        + CategoryInfo          : NotSpecified: (:) [],  
       MethodInvocationException
        + FullyQualifiedErrorId : DotNetMethodException
    Some of them like $Excel.Workbooks.Add, I got before, deleting the () at the end got no error

  • SQL Server Migration Assistant Error

    I am trying to convert my access database to SQL Server 2008. I am running Access 2003 and am using the SQL Server Migration Assistant 2008. As soon as I try to import the current Access database I get the following error:
    Access Object Collector error: Database
         Unable to cast COM object of type 'Microsoft.Office.Interop.Access.Dao.DBEngineClass' to interface type 'Microsoft.Office.Interop.Access.Dao._DBEngine'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{00000021-0000-0010-8000-00AA006D2EA4}' failed due to the following error: Error loading type library/DLL. (Exception from HRESULT: 0x80029C4A (TYPE_E_CANTLOADLIBRARY)).
         An error occurred while loading database content.
    I am not really sure how to get past this. I found the DAO360.ddl file in program files/common files and in windows/servicepack files. I have reinstalled Access and also tried the other version of the migration assistant. At this point I am stuck. Any suggestions how to get beyond this barrier?
    Thanks!

    Hello Alberto,
    I'm having the same problem. I registered the Dao360.dll as you suggested in your previous post.
    There were several entries in the registry for this file.
    C:\Program Files\Common Files\Microsoft Shared\DAO\ is in the system path variable.
    Vijay Patil from the SSMA Team has been looking at this issue for me and here is her last email.
    I’m running XP PRO SP3, Access 2000 and SQL Server 2008 Enterprise Edition.
    (From Vijay)
    Hi Howard,
    We have tried to migrate the .mdb which you have shared with Access 2000 and the migration was successful.
    We are unable to replicate the same error at our end. There could be issue with the DAO file and so is the error which you have mentioned.
    This could be one reason for the issue which you are facing.
    Please check this below link for information on DAO
    http://social.msdn.microsoft.com/Forums/en/sqlsetupandupgrade/thread/65892da4-4c1e-4578-9667-22faf87f2ac8
    Thanks,
    SSMA Team
    I’ve included the entries from the log for your review. Any and all suggestion would be greatly appreciated.
    I will supply any additional information you may require. Thank you for your time with this matter.
    Best Regards
    Howard
    [Gui: Info] [3172/1] [2010-03-30 15:17:58]: Starting user interface initialization.
    [Gui: Info] [3172/1] [2010-03-30 15:17:59]: User interface initialization finished.
    [Generic: Mandatory] [3172/1] [2010-03-30 15:17:59]: SQL Server Migration Assistant 2008 for Access v4.0.1336
    [Gui: Info] [3172/1] [2010-03-30 15:18:02]: MainMenu: press button - text:File, name:File
    [Gui: Info] [3172/1] [2010-03-30 15:18:09]: MainMenu: press button - text:New Project..., name:newProject
    [Gui: Info] [3172/1] [2010-03-30 15:18:16]: MainMenu: press button - text:Tools, name:Tools
    [Gui: Info] [3172/1] [2010-03-30 15:18:17]: MainMenu: press button - text:Global Settings, name:GlobalSettings
    [Gui: Info] [3172/1] [2010-03-30 15:18:41]: MainMenu: press button - text:File, name:File
    [Gui: Info] [3172/1] [2010-03-30 15:18:44]: MainMenu: press button - text:Add Databases, name:connectToSource
    [Collector: Error] [3172/5] [2010-03-30 15:18:55]: Access Object Collector: An error occurred while loading database content.
    [Collector: Error] [3172/5] [2010-03-30 15:18:55]: Exception: Retrieving the COM class factory for component with CLSID {CD7791B9-43FD-42C5-AE42-8DD2811F0419} failed due to the following error: 80040154.
     site: Microsoft.SSMA.Framework.Access.DaoUtils.DaoMdbConnection ConnectToDatabaseImpl(System.String, Boolean, System.String, System.Nullable`1[Microsoft.SSMA.Framework.Access.DaoUtils.WorkgroupPolicySettings])
     source: Microsoft.SSMA.Framework.Access.DaoUtils
     error code: -2147221164
       at Microsoft.SSMA.Framework.Access.DaoUtils.DaoUtilities.ConnectToDatabaseImpl(String fileName, Boolean readOnly, String password, Nullable`1 workgroupPolicySettings)
       at Microsoft.SSMA.Framework.Access.DaoUtils.DaoUtilities.TryConnectToDatabase(String fileName, Boolean readOnly, String& password, PasswordAsker passwordAsker, Nullable`1& workgroupPolicySettings, WorkgroupPolicyAsker workgroupPolicyAsker)
       at Microsoft.SSMA.Framework.Access.DaoUtils.DaoUtilities.ConnectToDatabase(String fileName, Boolean readOnly, String& password, PasswordAsker passwordAsker, Nullable`1& workgroupPolicySettings, WorkgroupPolicyAsker workgroupPolicyAsker)
       at Microsoft.SSMA.Framework.Access.Generic.AccessConnectionUtilities.ConnectToMdbFile(XNode xMdbFile, Boolean readOnly, IUIAskPasswordProvider askPasswordProvider, IUIWorkgroupPolicyProvider workgroupPolicyProvider)
       at Microsoft.SSMA.Framework.Access.Collector.Loaders.MDBFileLoader.LoadChildren(XNode xNode)
    [Gui: Info] [3172/1] [2010-03-30 15:18:56]: Access Object Collector error: Database
         Retrieving the COM class factory for component with CLSID {CD7791B9-43FD-42C5-AE42-8DD2811F0419} failed due to the following error: 80040154.
         An error occurred while loading database content.
    [Gui: Info] [3172/1] [2010-03-30 15:19:01]: MainMenu: press button - text:File, name:File
    [Gui: Info] [3172/1] [2010-03-30 15:19:05]: MainMenu: press

  • Synchronization problem with BBr curve 9320 and outlook 2010

    Following the installation of office 2010 it's impossible to synchronize my BBR wth my PC; I get the message below:
    Thanks for your help.
    Message:
    Caught_com_error exception. description();(null); error(): 2147312566 (0x80029C4A);
    Errormessage(): erreur lors du chargement de la bibliothèque/DLL dy type; Source();(null)
    Solved!
    Go to Solution.

    Dychow wrote:
    I'm dylan from malaysia. I facing a problem! What the service about blackberry? I cannot find an contact to call blackberry customer service! Does Blackberry have office in malaysia?? My blackberry device 9320, always like burning (feeling hot), no matter i take off the battery and fix back, or i restart back the device, still the same question! And it kill my battery faster! WTF with this problem?
    Hi and Welcome to the Community!
    BlackBerry actually provides zero front line support to end users, including warranty...all support starts with the carriers, authorized resellers, and authorized service centers, all who can escalate cases into BlackBerry at no charge to the end user. So your service/support path would start by checking your original purchase documentation and finding out what it tells you regarding how it works in your region -- it can vary by region as well as by specific issue. From what you describe, your's sounds like a device-level issue, which would therefore be either an authorized service center or your original place of purchase.
    There also might be some good reading here:
    http://us.blackberry.com/legal/handheld-limited-warranty.html
    If you remain unsure where to go, then I'd recommend you check with your original place of purchase or your mobile service provider for local guidance.
    Good luck!
    Occam's Razor nearly always applies when troubleshooting technology issues!
    If anyone has been helpful to you, please show your appreciation by clicking the button inside of their post. Please click here and read, along with the threads to which it links, for helpful information to guide you as you proceed. I always recommend that you treat your BlackBerry like any other computing device, including using a regular backup schedule...click here for an article with instructions.
    Join our BBM Channels
    BSCF General Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • Install Shield Problem can;t install or uinstall anyth

    I getError Code:?-5004 : 0x80029c4a
    Error Information:
    >SetupDLL\SetupDLL.cpp (975)
    pAPP:Creative Sound Blaster Audigy, Audigy 2 series and Audigy 4 series Driver
    PVENDOR:Creative Technology Ltd.
    PGUID:AAF283AE-985D-4B8A-AFEC-A742D5A797E9
    $9..0.429ice Pack 2 (2600) IE 7.0.6000.6608?everytime I try to uninstall or install any creative player or driver. I have win XP pro I have an audigy platinum, and I'm trying to get my optical ports working again. Can ny one help me?

    Quote from: meegja on 30-May-13, 04:22:31
    What operating system are you using? Also what kind of CPU and memory do you have in your system? All bits of info can help
    OS: Windows 8 64-bit.
    CPU: Pentium D 2.8 GHz
    RAM: 3.5 GB
    I don't know how this can help except for the OS bit, but i'll just state it.

  • Failed to import ActiveX control

    I am using VB2005 express and VC#2005 express. With my old friend
    VS2003, whenever i needed to add flash to my WInforms, all i needed to
    do was to add the control as a com component and drag it on the stage
    from the toolbar. Now, when i did the same in new express version,
    althogh it is added in the toolbars and the references list, but still,
    whenever i try to drag a shockwave flash instance on my win form, i get
    the error:
    Failed to import ActiveX control, please ensure it is properly registered.
    does some one have any idea how to add flash comntrol as we used to do in earlier versions? Please reply this ASAP.
    Thanks and regards.
    Syed Mazhar Hasan

    None of these solutions are working for me.
    In VS2005 I'm stuck. I also have VB6 installed, and there the OCX imports fine. In VS2005 I get the above error message, but sometimes I also get a ResolveComReference error.
    1) When I go to the obj directories the interop files aren't even generated (so the delete then re-add solution doesn't work for me).
    2) running tlbimp on the ocx gives me a TI0000.exe error - Error loading library
    3) running aximp on the ocx generates a TYPE_E_CANTLOADLIBRARY error.
    This ocx has loaded fine in VS2005 before I reformatted my PC, and loads fine on other machines. VS2005 is local, but our code is on a server share drive, so my first thought was some kind of security settings was messed up, but I moved everything to a local drive and still no dice.
    I've also made sure that I have the latest VS2005 service packs, and XP is compeletly up-to-date.
    I've been working on this for almost a week with no progress, and I'm getting pretty desperate. Anyone have any other ideas?

Maybe you are looking for