No se si hay algo qyue estoy haciendo mal en la adaptación o si es que el código sirve sólo cuando se trata del mismo archivo.
El código adaptado es el siguiente:
Código: Seleccionar todo
Sub Buscar_2
Dim oDoc as Object, oHoja as Object
cadena = InputBox("Dato a buscar ....", "Busqueda")
Ruta= "\\WS34400009\D\OPEN_SUR\CAMBJURIS_PRUEBA.ods"
oDoc = AbrirArchivo (Ruta, True, "02081938", 3, "False") '(Ruta, Oculto, password, con Macro, SoloLectura)
'BUSCA EL CUIT EN LA BASE DE Cambios
oHoja= oDoc.Sheets.getByName("Concluidos")
'oHoja.isVisible = "True"
oHoja.unProtect ( "02081938" )
UltFila= UltimaFila(oHoja)+1
'MsgBox "La fila es "&UltFila
oBuscarEn = oHoja.getCellRangeByName( "B2:B"+UltFila)
document = oDoc.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
dim args1(2) as new com.sun.star.beans.PropertyValue
args1(0).Name = "ToPoint"
args1(0).Value = oBuscarEn '"$B$1:$B$11000"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args1())
args1(0).Name = "SearchItem.CellType"
args1(0).Value = 1
args1(1).Name = "SearchItem.SearchString"
args1(1).Value = cadena
args1(2).Name = "SearchItem.Command"
args1(2).Value = 1
dispatcher.executeDispatch(document, ".uno:ExecuteSearch", "", 0, args1())
sele = oDoc.getCurrentSelection()
consulta = sele.queryContentCells(21)
filas = consulta.getCount - 1
Fil = (sele(filas).getCellAddress.row + 1)
msgbox Fil
end sub
Ya probé de todo... pero no doy en la tecla. Les agradezco cualquier sugerencia.
Un saludo desde Buenos Aires.
Chelo2