iLogic case sensitive

iLogic case sensitive

meck
Collaborator Collaborator
1,131 Views
2 Replies
Message 1 of 3

iLogic case sensitive

meck
Collaborator
Collaborator

I'm reading data out of an Excel file using iLogic. I've noticed that while finding a row (GoExcel.FindRow) that the matching cell value has to have a matching case also. Is there a way to ignor the case and just match the text? I'm currently working around it by switching everything to upper case, but that is only so I can continue on. I really need to able to ignor the case.

 

Thanks,

 

Here's my code:

i = GoExcel.FindRow(DBLocation & "Bases.xlsx", "RefSheet", "ManSeriesBore", "="BrgManSeriesBore)

 

 

Mike Eck
Master Drafter/ CAD Programmer
Using Inventor 2018
0 Likes
Accepted solutions (1)
1,132 Views
2 Replies
Replies (2)
Message 2 of 3

MjDeck
Autodesk
Autodesk
Accepted solution

Here is some code to match different cases in the Excel data.  We should probably add an option to ignore case.

i = GoExcel.FindRow(DBLocation & "Bases.xlsx", "RefSheet", "ManSeriesBore", "=",  BrgManSeriesBore)
If (i < 0) Then
  i = GoExcel.FindRow(DBLocation & "Bases.xlsx", "RefSheet", "ManSeriesBore", "=",  [BrgManSeriesBore].ToUpper) ' match all uppercase
End if
If (i < 0) Then
  i = GoExcel.FindRow(DBLocation & "Bases.xlsx", "RefSheet", "ManSeriesBore", "=",  [BrgManSeriesBore].ToLower) ' match all lowercase
End if
If (i < 0) Then
  i = GoExcel.FindRow(DBLocation & "Bases.xlsx", "RefSheet", "ManSeriesBore", "=",  StrConv(BrgManSeriesBore, VbStrConv.ProperCase)) ' match with first letters capitalized
End if

There is another option that involves less code, but it requires that none of the cells in the column contains a string that is a substring of another cell.  You can use the "Contains" option to search instead of "=".  This will ignore the case.

i = GoExcel.FindRow(DBLocation & "Bases.xlsx", "RefSheet", "ManSeriesBore", "Contains",  BrgManSeriesBore)

 

 


Mike Deck
Software Developer
Autodesk, Inc.

0 Likes
Message 3 of 3

meck
Collaborator
Collaborator

Thanks!

Mike Eck
Master Drafter/ CAD Programmer
Using Inventor 2018
0 Likes