Critical Error using GoExcel / Interop

Critical Error using GoExcel / Interop

harvey_craig2RCUH
Advocate Advocate
371 Views
3 Replies
Message 1 of 4

Critical Error using GoExcel / Interop

harvey_craig2RCUH
Advocate
Advocate

I have this error when using GoExcel / Interop in Inventor iLogic:

 

Unable to cast COM object of type 'Microsoft.Office.Interop.Excel.ApplicationClass' 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: Element not found. (Exception from HRESULT: 0x8002802B (TYPE_E_ELEMENTNOTFOUND)). 

 

I have found an article with similar error on Autodesk:

 https://www.autodesk.com/support/technical/article/caas/sfdcarticles/sfdcarticles/Error-in-rule-Unab...

That suggests that I need to reinstall  office/windows. I am in a work environment so these two tasks would require serious IT intervention. These errors occur if I use GoExcel or Interop. I have tried restarting the PC to no avail. Has anyone come across this error that has an easier fix than reinstalling office/operating system? My Inventor projects rely heavily on reading/writing data to Excel spreadsheets.

 

Many thanks,

Harvey

0 Likes
Accepted solutions (1)
372 Views
3 Replies
Replies (3)
Message 2 of 4

Michael.Navara
Advisor
Advisor
Accepted solution

I don't know if it helps, but you can try to check, if you use COM for Excel in iLogic settings.

 

Also you can try to work with Excel from powershell terminal. This is similar to how Inventor works with Excel.

Lines explanation:

6: Start new excel app

7: Test if excel is responding

9: Quit excel application

10: Cleanup powershell variable

11: Cleanup memory

 

Terminal content

 

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Install the latest PowerShell for new features and improvements! https://aka.ms/PSWindows

PS C:\Temp> $excel=new-object -COM excel.application
PS C:\Temp> $excel.Caption
Excel
PS C:\Temp> $excel.Quit()
PS C:\Temp> Remove-Variable excel
PS C:\Temp> [System.GC]::Collect()
PS C:\Temp> 

 

 

0 Likes
Message 3 of 4

harvey_craig2RCUH
Advocate
Advocate

Thanks that did help, I switched from COM to internal. This may be as a temporary fix as I read in the documentation that I require COM to:

  • Write to an embedded spreadsheet

 

Do you know if the COM engine just applies to the use of GoExcel? Does Interop use the Internal/COM engine?

 

Thanks,

Harvey

0 Likes
Message 4 of 4

harvey_craig2RCUH
Advocate
Advocate

I realise that I may have originally been on the Internal engine, I attempted that first case, Inventor switched me over to the COM engine and there may always have been a problem with the Excel API at my workplace, so I started getting the error.

 

Thanks for highlighting,

Harvey

0 Likes