Forum Discussion

Sadams's avatar
Sadams
Cover User
5 years ago

Problems exporting reports to Excel

I am using AccountRight AU 2020.3.1.  I have just started to excperience a problem wit exporting reports to Excel (using Office 365).  This feature was working fine last week but I now get no response when I go to export any reports to Excel.  Similar with PDF although this saves the file to a folder and I can retrieve it through a PDF viwer.  I have tried sending by email but this also errors (See attached screenshot).  Any suggestions would be appreciated.

  • Hi Sadams 

     

    The error log mentions this specific error, " System.InvalidCastException: Unable to cast COM object of type 'Microsoft.Office.Interop"

     

    Generally, this error means that when a program such as AccountRight asks which version of Excel is installed, the wrong version is being reported back, causing a communication problem and errors between the programs.

    This can happen when different versions of Office/Excel may have been previously installed on the computer, and components/values are left behind. A 
    range of these errors can be fixed by one of the following:

     
    1. Quick Repair office. (any missing files should be added back)

    2. Check/Fix Registry Keys (this step can only be completed by an IT professional as this is an environmental issue with windows having missing or incorrect information). Reference link as an example for Outlook is :

    https://webmakers.co.nz/interface-not-registered-exception-from-hresult-0x80040155-microsoft-office-...

     

    Feel free to post should you have any other queries.

  • Hi Sadams 

     

    On this error window, if you click on "View error details", it will produce a detailed log containing reasons for why the system is crashing. Can you please attach the log here so we can investigate further and advise accordingly.

    • Sadams's avatar
      Sadams
      Cover User

      AccountRight Application Error Report
      =====================================
      Application Version: 2020.3.24.318
      Application File Version: 2020.3.24.1678
      Incident Id: 7c513db5-7e10-42e9-b1ce-b39175ff0e49
      Time: Monday, December 7, 2020 5:40:12 AM

      Code:
      System.InvalidCastException


      Message:
      Unable to cast COM object of type 'Microsoft.Office.Interop.Outlook.ApplicationClass' to interface type 'Microsoft.Office.Interop.Outlook._Application'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{00063001-0000-0000-C000-000000000046}' failed due to the following error: Error loading type library/DLL. (Exception from HRESULT: 0x80029C4A (TYPE_E_CANTLOADLIBRARY)).


      Stack Trace
      ----------------------------------------
      1 : System.InvalidCastException
      ----------------------------------------
      System.InvalidCastException: Unable to cast COM object of type 'Microsoft.Office.Interop.Outlook.ApplicationClass' to interface type 'Microsoft.Office.Interop.Outlook._Application'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{00063001-0000-0000-C000-000000000046}' failed due to the following error: Error loading type library/DLL. (Exception from HRESULT: 0x80029C4A (TYPE_E_CANTLOADLIBRARY)).
      at mscorlib!0x06004227!System.StubHelpers.StubHelpers.GetCOMIPFromRCW(Object objSrc, IntPtr pCPCMD, IntPtr& ppTarget, Boolean& pfNeedsRelease)
      at Microsoft.Office.Interop.Outlook!0x06002365!Microsoft.Office.Interop.Outlook.ApplicationClass.CreateItem(OlItemType ItemType)
      at Huxley.MsOffice.Integration!0x06000078!MYOB.Huxley.MsOffice.Integration.OutlookEmail.OutlookEmailProvider.SendMessage(String emailAddresses, String subject, String body, EmailResourceType resourceType, String documentNumber, IEnumerable`1 attachments) +0xf4
      at Huxley.UI.Controllers!0x060024de!MYOB.Huxley.UI.Controllers.Helpers.EmailHelper.SendMessage(String to, String subject, String body, EmailResourceType resourceType, String documentNumber, IEnumerable`1 attachments) +0x0
      at Huxley.UI.Forms!0x06003efd!MYOB.Huxley.UI.Forms.Cards.CardEmail.<>c__DisplayClass6_0.<OnOkClicked>b__1() +0x15
      at Huxley.UI.Forms!0x06002f5f!MYOB.Huxley.UI.Forms.BaseForms.BaseViewContainer.PerformAction(Action methodToPerform) +0x16
      at Huxley.UI.Forms!0x06001ddb!MYOB.Huxley.UI.Forms.Cards.CardEmail.OnOkClicked(ButtonClickedArgs args) +0xca
      at Huxley.UI.Forms!0x06002c45!MYOB.Huxley.UI.Forms.BaseForms.BaseViewForm.CallButtonClicked(Action`1 execute, ButtonClickedArgs args, String buttonText) +0x12
      at Huxley.UI.Forms!0x06002bbf!MYOB.Huxley.UI.Forms.BaseForms.BaseViewForm.btnOk_Click(Object sender, EventArgs e) +0x30
      at System.Windows.Forms!0x06000e16!System.Windows.Forms.Control.OnClick(EventArgs e) +0x19
      at DevExpress.XtraEditors.v17.1!0x06000d4f!DevExpress.XtraEditors.BaseButton.OnClick(EventArgs e) +0x2e
      at DevExpress.XtraEditors.v17.1!0x06000d48!DevExpress.XtraEditors.BaseButton.OnMouseUp(MouseEventArgs e) +0x1d
      at System.Windows.Forms!0x06000efd!System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) +0x184
      at System.Windows.Forms!0x06000f0d!System.Windows.Forms.Control.WndProc(Message& m) +0x49f
      at DevExpress.Utils.v17.1!0x06002708!DevExpress.Utils.Controls.ControlBase.WndProc(Message& m) +0x2e
      at DevExpress.XtraEditors.v17.1!0x06000256!DevExpress.XtraEditors.BaseControl.WndProc(Message& msg) +0x0
      at System.Windows.Forms!0x0600571b!System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) +0x0
      at System.Windows.Forms!0x0600571e!System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) +0x8e
      at System.Windows.Forms!0x06002deb!System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) +0x25
      ==========
      MODULE: DevExpress.Utils.v17.1 => DevExpress.Utils.v17.1, Version=17.1.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a; G:b8c34c059b804930811d5f6d50999b6c; A:1
      MODULE: DevExpress.XtraEditors.v17.1 => DevExpress.XtraEditors.v17.1, Version=17.1.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a; G:6df94e55f5bd4444b910d4b2a37076a4; A:1
      MODULE: Huxley.MsOffice.Integration => Huxley.MsOffice.Integration, Version=2020.3.24.318, Culture=neutral, PublicKeyToken=947f70fecdd4159f; G:45807b1f8b88416e9509d3e2e9202202; A:1
      MODULE: Huxley.UI.Controllers => Huxley.UI.Controllers, Version=2020.3.24.318, Culture=neutral, PublicKeyToken=947f70fecdd4159f; G:a088d0c294f548b99b7dbaf81e7c3498; A:1
      MODULE: Huxley.UI.Forms => Huxley.UI.Forms, Version=2020.3.24.318, Culture=neutral, PublicKeyToken=947f70fecdd4159f; G:3fd1a8442312472b80a6f5c520e84cda; A:1
      MODULE: Microsoft.Office.Interop.Outlook => Microsoft.Office.Interop.Outlook, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c;
      MODULE: mscorlib => mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089; G:f8bf46ea6bc64b5092c28343c64b72a8; A:2
      MODULE: System.Windows.Forms => System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089; G:c643f8c6b47f4807860bf3c099806bf8; A:1

      ----------------------------------------

       

       

      • Komal_S's avatar
        Komal_S
        MYOB Staff

        Hi Sadams 

         

        The error log mentions this specific error, " System.InvalidCastException: Unable to cast COM object of type 'Microsoft.Office.Interop"

         

        Generally, this error means that when a program such as AccountRight asks which version of Excel is installed, the wrong version is being reported back, causing a communication problem and errors between the programs.

        This can happen when different versions of Office/Excel may have been previously installed on the computer, and components/values are left behind. A 
        range of these errors can be fixed by one of the following:

         
        1. Quick Repair office. (any missing files should be added back)

        2. Check/Fix Registry Keys (this step can only be completed by an IT professional as this is an environmental issue with windows having missing or incorrect information). Reference link as an example for Outlook is :

        https://webmakers.co.nz/interface-not-registered-exception-from-hresult-0x80040155-microsoft-office-...

         

        Feel free to post should you have any other queries.