Thanks to the response message by [EMAIL PROTECTED] on 2005-09-07. OO: 1.9.125 OS: MS Windows XP
* interactive search enter dates in a few cells, like cell 01: 2005-10-01 cell 02: 2005-10-07 etc. The display of cells varies with the format control. Mine are displayed as mm/dd/yy due to the default locale setting after installation. actions: edit and replace, enter a date as displayed (mm/dd/yy in my case), find options: tried all options in "search in" (formula, value, notes) error dialog window dialog title: OpenOffice.org 1.9.125 dialog body: Search Key not found. * programmatic search - OO basic My test code did not work. The test code is included below, in case that the mail list server rejects the attached *.sxc test file. I entered a mixture of test dates and strings in separate cells. The code works for strings, but not for dates. Note that the search pattern for dates is made consistent with the display format of date entries. You might have to change the code to make it consistent with your locale. Can you advise where the mistake is in the test code? Thanks. Ray --- REM ***** BASIC ***** option explicit Sub test() dim sht_name as string dim sht_src as variant dim rr as long, cc as long, pttn as string rr = -1 cc = -1 pttn = "test 01" pttn = "10/01/05" sht_name = "sheet1" sht_src = thiscomponent.sheets.getByName( sht_name ) err = sheet_data_head_test( sht_src, rr, cc, pttn ) msgbox( "cell location: " & rr & " " & cc ) End Sub ' find a single cell containing the regular expresstion text ' let it crash to help debug the date searching function sheet_data_head_test( sht as variant, rr_id as long, cc_id as long, pttn as string ) as integer dim ptr as variant, fnd as variant, adr as variant set ptr = sht.createSearchDescriptor() ptr.searchString = pttn ptr.searchRegularExpression = false ' XCellAddress = aSheetCell.getCellAddress() set fnd = sht.findFirst( ptr ) set adr = fnd.cellAddress rr_id = adr.row cc_id = adr.column sheet_data_head_test = 0 end function
tst date.sxc
Description: tst date.sxc
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
