- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Recently I am having trouble with a script that reads data from an excel file. The file location, permissions or script has not been changed since the last time it has properly worked. This was last friday.
The normal workflow involves checking out the excel file from the autodesk vault, checking out the assembly and all underlying components. Reading some values from the excel file / or changing them manually in order to get a different configuration. And then running all other scripts to modify the inventor parts.
Last Friday while shutting down windows did an update. The following software was installed:
KB4023057: Update voor Windows Update Service-onderdelen - Microsoft Ondersteuning
Right now my way of getting data from excel is returning the following error (my original script is longer but i want to isolate the issue). The filepath and filename have not changed. So this cannot be the issue. Xlsm is also correct since the workbook uses macros. I have also tried the same method of retrieving data but from a different excel file. This results in the same errors.
Dim sfile As String = "C:\VaultWorkSpace\Designs\Test\Versis parametric model\Versis input sheet.xlsm" SharedVariable("Model") = GoExcel.CellValue(sfile, "Input", "B1")
Inventor returns the following message when i try to run the script:
Error in rule: Test, in document: 000076253.iam
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)).
And under more info:
System.InvalidCastException: 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)).
at System.StubHelpers.StubHelpers.GetCOMIPFromRCW(Object objSrc, IntPtr pCPCMD, IntPtr& ppTarget, Boolean& pfNeedsRelease)
at Microsoft.Office.Interop.Excel.ApplicationClass.get_Hwnd()
at Autodesk.iLogic.Core.ExcelInterface.ExcelApplicationWrapper.CreateAndRecordApplication()
at Autodesk.iLogic.Core.ExcelInterface.ExcelApplicationManager.GetApplication()
at iLogic.GoExcel.EnsureApplication()
at iLogic.GoExcel.SetCurrentSheet(String fileName, String sheetName)
at iLogic.GoExcel.SetCurrentSheetNoCache(String bookName, String sheetName)
at iLogic.GoExcel.get_CellValue(String fileName, String sheetName, String cellAddress)
at ThisRule.Main()
at Autodesk.iLogic.Exec.AppDomExec.ExecRuleInAssembly(Assembly assem)
at iLogic.RuleEvalContainer.ExecRuleEval(String execRule)
My current inventor version is Build: 245, Release: 2021.1 - Date: Tue 07/21/2020
Any help would be greatly appreciated.
Solved! Go to Solution.