Error when emailing invoices from AccountRight

This thread is now closed to new comments.
Some of the links and information provided in this thread may no longer be available or relevant.
If you have a question please start a new post.
Cameron45
3 Posts
User

3Posts

0Kudos

0Solutions

Error when emailing invoices from AccountRight

This has started a couple of days ago - I have tried the 3 steps listed in this article (https://community.myob.com/t5/AccountRight-Sales-and-purchases/Error-when-Sending-Emails-amp-PO-s-fr...) to no avail - have completely uninstalled and reinstalled both Office and MYOB, and gone throught the other steps and the same problem exists. 

Here is the complete error report

AccountRight Application Error Report
=====================================
Application Version: 2022.11.24.7649
Application File Version: 2022.11.24.7649
Incident Id: b11efe9b-fe94-4a33-b7b6-830614a5726c
Time: Wednesday, 25 January 2023 9:51:49 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!0x06000079!MYOB.Huxley.MsOffice.Integration.OutlookEmail.OutlookEmailProvider.SendMessage(String emailAddresses, String subject, String body, EmailResourceType resourceType, String documentNumber, IEnumerable`1 attachments) +0xc2
at Huxley.UI.Controllers!0x0600304b!MYOB.Huxley.UI.Controllers.Helpers.EmailHelper.<>c__DisplayClass46_0.<SendEmail>b__1() +0x68
at Huxley.UI.Controllers!0x060021e3!MYOB.Huxley.UI.Controllers.Helpers.EmailHelper.TrackAndPerformSendEmailLocally(Func`1 sendEmail, EmailResourceType resourceType, Nullable`1 companyDataFileId, Nullable`1 invoiceId) +0x3e
at Huxley.UI.Controllers!0x060021d9!MYOB.Huxley.UI.Controllers.Helpers.EmailHelper.SendEmail(String to, String subject, String body, String pdfFileName, EmailResourceType resourceType, FormTemplateDefinition formTemplateDefinition, FormPrintingParams formPrintingParams, IEnumerable`1 attachments, Nullable`1 entityUid, LayoutType layoutType, String documentNumber) +0x1b4
at Huxley.UI.Controllers!0x06001a2d!MYOB.Huxley.UI.Controllers.SalesAndPurchases.SendEmailController.SendEmail(String emailAddress, String subject, String message, IEnumerable`1 attachments) +0x88
at Huxley.UI.Controllers!0x06001a2c!MYOB.Huxley.UI.Controllers.SalesAndPurchases.SendEmailController.SendEmail(String emailAddresses, String subject, String message) +0xb
at Huxley.UI.Forms!0x06001ece!MYOB.Huxley.UI.Forms.SalesAndPurchases.SendEmail.<OnOkClicked>b__22_0() +0x0
at Huxley.UI.Forms!0x0600272b!MYOB.Huxley.UI.Forms.BaseForms.BaseViewContainer.PerformAction(Action methodToPerform) +0x16
at Huxley.UI.Forms!0x06001eae!MYOB.Huxley.UI.Forms.SalesAndPurchases.SendEmail.OnOkClicked(ButtonClickedArgs args) +0x48
at Huxley.UI.Forms!0x06002410!MYOB.Huxley.UI.Forms.BaseForms.BaseViewForm.CallButtonClicked(Action`1 execute, ButtonClickedArgs args, String buttonText) +0x12
at Huxley.UI.Forms!0x0600238a!MYOB.Huxley.UI.Forms.BaseForms.BaseViewForm.btnOk_Click(Object sender, EventArgs e) +0x30
at System.Windows.Forms!0x06000e1d!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!0x06000f04!System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) +0x184
at System.Windows.Forms!0x06000f14!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!0x0600572a!System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) +0x0
at System.Windows.Forms!0x0600572d!System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) +0x8e
at System.Windows.Forms!0x06002df3!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=2022.11.24.7649, Culture=neutral, PublicKeyToken=947f70fecdd4159f; G:7a54747470bc429b9ffcc3dbe0284b57; A:1
MODULE: Huxley.UI.Controllers => Huxley.UI.Controllers, Version=2022.11.24.7649, Culture=neutral, PublicKeyToken=947f70fecdd4159f; G:ded0a1c5885c4bf094d04423a58c475e; A:1
MODULE: Huxley.UI.Forms => Huxley.UI.Forms, Version=2022.11.24.7649, Culture=neutral, PublicKeyToken=947f70fecdd4159f; G:be7fd554a6d64272a599c4e174cc6a34; 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:5d8d5a93fd7d46e1910ef4af099a2ad0; A:2
MODULE: System.Windows.Forms => System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089; G:543c9eec2a3d4078aab81f89e0020776; A:1

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

 

 



3 REPLIES 3
Komal_S
MYOB Moderator
8,280 Posts
MYOB Moderator
MYOB Moderator

8,280Posts

741Kudos

1,164Solutions

Re: Error when emailing invoices from AccountRight

Hi @Cameron45 

 

The log that you've attached mentions this specific error "Unable to cast COM object of type 'Microsoft.Office.Interop.Outlook.ApplicationClass" which is an interop error meaning when a program such as AccountRight asks which version of Office/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.

 

There is a range of interop errors, these most often are fixed by one of the following:

 
A. Quick Repair office. (any missing files should be added back)
B. Re-Register DLL files and Check/Fix Registry Keys (there are 3 to complete)

Step B would require an IT Professional as its an environmental issue, with windows having missing or incorrect information and this help article has similar instructions which might help: 

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

Kind regards,
Komal

MYOB Community Support

Online Help| Forum Search| my.MYOB| Download Page

Did my answer help?

Mark it as a SolutionHelpful? Leave a to tell others

Cameron45
3 Posts
User

3Posts

0Kudos

0Solutions

Re: Error when emailing invoices from AccountRight

Thanks for the reply. I have tried all those suggestions, but the problem still exisits. Are there any other options?

Komal_S
MYOB Moderator
8,280 Posts
MYOB Moderator
MYOB Moderator

8,280Posts

741Kudos

1,164Solutions

Re: Error when emailing invoices from AccountRight

Hi @Cameron45 

As it is environmental error, we'd recommend seeking IT assistance to check Windows Event Viewer for further issues or errors with the Outlook. 

Kind regards,
Komal

MYOB Community Support

Online Help| Forum Search| my.MYOB| Download Page

Did my answer help?

Mark it as a SolutionHelpful? Leave a to tell others

Didn't find your answer here?

Try using advanced search to find a post more easily Advanced Search
or
Get the conversation started and make a new post Start a Post