Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi
I have a small problem... I have this ilogic rule that will add properties into my file from an Excel sheet.
First the user will enter the part number that gives the row where the information is to be found.
But what I do not get to work is: if the part number that the user enters do not exist in the Excel sheet, I want an Error message...
I have tried different things but dont get it to work...
Can someone please help?
' User will give part number in an input box: strNum = InputBox("Please enter the part number", "Get Data") ' Excel sheet with information, column 1= Part Num, column 2=Description i = GoExcel.FindRow("c:\export.xlsx", "Sheet1", "Part Num", "=", strNum) 'If strNum Is Not found Then 'MessageBox.Show("Part Number does not exist in Excel sheet", "Error") 'If i <> "Part Num" Then If strNum <> "" Then MessageBox.Show("Part Number does not exist in Excel sheet", "Error") Else ' Get property from excel strDesc = GoExcel.CurrentRowValue("Description") ' Add properties iProperties.Value("Project", "Part Number") = strNum iProperties.Value("Project", "Description") = strDesc End If
Best regards
TG
Autodesk Inventor/Vault Professional 2021
TG
Autodesk Inventor/Vault Professional 2021
Solved! Go to Solution.