.find method with match case

by KGV at 2013-01-31 08:18:42

Hi,

I tried searching, but I could not find how to set the Excel .find method so that it was case sensitive. I am running a PowerShell script similar to what is shown below. It matches the text regardless
of the case, but I want an extact match. What parm would I need to set?

Thanks

$workbook = $Excel.Workbooks.Open("$FileName")
$firstSheet = $workbook.worksheets.item(1)
$aa = $firstsheet.activate()
$sheet = $workbook.Sheets.Add()
$YesterdaySheet = $Workbook.Worksheets.Item(2)
$Range = $YesterdaySheet.Range(“A1”).EntireColumn
$line = …
$SearchString = …
$Search = $Range.find($SearchString)
If ($Search -ne $null)
{
If ($Search.Text -ne $line)
by nohandle at 2013-01-31 23:53:44
No way to test it now but in this documentation http://msdn.microsoft.com/en-us/library … (office.11).aspx I see optional parameter that makes the function match case. (It is office 2003 but I don’t think much changed since.)