It works fine on my laptop. I pack n go the assembly to a desktop PC and when i run the rule i get the following error message;
"System.Runtime.InteropServices.COMException (0x80004005): Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))
at System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData& msgData)
at Inventor.iPartMember.get_Row()
at ThisRule.Main()
at Autodesk.iLogic.Exec.AppDomExec.ExecRuleInAssembly(Assembly assem)
at iLogic.RuleEvalContainer.ExecRuleEval(String execRule)"
It is caused by the code i added that you suggested, also the slightly adjusted solution i gave gives the same error, any idea what causes this?
your latest code
Dim iPartOcc As ComponentOccurrence = oAsmDoc.ComponentDefinition.Occurrences.ItemByName("NameOfTheIpart")
If iPartOcc.IsiPartMember 'Just a check
Dim oMember As iPartMember = iPartOcc.Definition.iPartMember
MsgBox(oMember.Row.Item("columnName").Value) 'The row value
Else
MsgBox("Not an iPart-member")
End If
My slightly adjusted version since i already used Occurences earlier;
'If oOcc.Name = "oTypeKast" Then
'Dim oMember As iPartMember = oOcc.Definition.iPartMember
'oND = oMember.Row.Item("AsDiameterKast").Value'The row value
'End If
EDIT; I think it might have to do with the Office version of Excel, the Embedded file is a 1997-2003 workbook. (on both my laptop and desktop i use Inventor 2021)