Community
I am new to Ilogic and trying to write a Code, where I am looking for a cell value in Excel Sheet, then trying to use that value to create Inventor Parameter. The code I am trying to use is as follows;
Format:HTML Format
Version:1.0
StartHTML: 165
EndHTML: 16704
StartFragment: 314
EndFragment: 16672
StartSelection: 314
EndSelection: 314
SyntaxEditor Code Snippet
ImportsInventor.UnitsTypeEnum
oDoc=ThisApplication.ActiveDocument
oDocParameters=oDoc.ComponentDefinition.Parameters.UserParameters
oFactory=ThisApplication.ActiveDocument
oFactPath=ThisDoc.Path
oFactName=ThisDoc.FileName(False)'without extension
oFactNameFull=ThisDoc.PathAndFileName(True)
oMemberPath=oFactPath&"\"&oFactName&"\"
DimoFactoryExtAsString
IfoFactory.DocumentType=kPartDocumentObjectThen
oFactoryExt=".ipt"
ElseIfoFactory.DocumentType=kAssemblyDocumentObjectThen
oFactoryExt=".iam"
ElseIfoFactory.DocumentType=kDrawingDocumentObjectThen
oFactoryExt=".idw"
EndIf
DimFeatNameAsString
DimColNameAsString
oFactTable2=oFactPath&"\"&oFactName&"\Parameter.xlsx"
GoExcel.TitleRow=1
RowStart=2
RowEnd=100
ForRowNumber=RowStartToRowEnd
IfVal(GoExcel.CellValue(oFactTable2,"Sheet1","A"&RowNumber))<>0Then
NoRow=NoRow+1
FeatName=GoExcel.CellValue(oFactTable2,"Sheet1","B"&RowNumber)
ColName=GoExcel.CellValue(oFactTable2,"Sheet1","B"&RowNumber)
Try
Param=oDocParameters(FeatName)
Catch
oParameter=oDocParameters.AddByValue(FeatName, Test, kTextUnits)
EndTry
ExitFor
EndIf
Next
I am getting following error:
Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))
Need Help. Please respond.