Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MintJulep on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

CATIA VBA : range.Find exact value from CATIA

Status
Not open for further replies.

jissididi

Automotive
Joined
Mar 17, 2015
Messages
46
Location
FR
Hi everybody,

I made a macro exporting data (drawingtexts) into a newly created excelsheet "wbk1"
I want to make a check with another workbook ("wbk2") to find if the text I exported in my "wbk1" exists in "wbk2".
I need to use the
Code:
wbk2.usedrange.find(thetext,lookat:=XlWhole)
method (because I want an exact match) but it does not work.

Do you have an idea of what could be the problem ?

PS : when I use
Code:
wbk2.usedrange.find(thetext)
alone, it works but it also find me other cells in which ones the string is containing the text I'm looking for : but I dont want that.

Thanks in advance

Jissi
 
I found the answer to my problem

in CATIA
Code:
wbk2.usedrange.find(thetext,lookat:=XlWhole)
does not work

instead use
Code:
wbk2.usedrange.find(thetext,lookat:=true)
regards
 
According to Excel reference Const xlWhole = 1, so you make better if you replace True with number 1. If you work from CATIA VBA and you didn't link Excel libraries, then xlWhole constant is unknown which could cause your issues.

Tesak
- Play Tetris in CATIA V5 drawing
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top