• Viernes 19 de Abril de 2024, 04:26

Autor Tema:  ME MANDA ERROR EN FIND XLlookat  (Leído 1801 veces)

mexicano2013

  • Nuevo Miembro
  • *
  • Mensajes: 3
    • Ver Perfil
ME MANDA ERROR EN FIND XLlookat
« en: Viernes 22 de Marzo de 2013, 23:09 »
0
 :think:

mexicano2013

  • Nuevo Miembro
  • *
  • Mensajes: 3
    • Ver Perfil
Re:ME MANDA ERROR EN FIND XLlookat
« Respuesta #1 en: Viernes 22 de Marzo de 2013, 23:12 »
0
quiero buscar un texto en un rango en excel, pero me manda error, alguien me puede ayudar por fa, estoy trabajando en en vb.net 2013 y excel
Imports Microsoft.Office.Interop.Excel

Public Class Nivelacion


Dim excel As New Microsoft.Office.Interop.Excel.Application


Private Sub DemoFind()
    Dim currentFind As Excel.Range = Nothing
    Dim firstFind As Excel.Range = Nothing

    ' You should specify all these parameters every time you call this method,
    ' since they can be overridden in the user interface.
    currentFind = Me.Fruits.Find("apples", , _
        Excel.XlFindLookIn.xlValues, Excel.XlLookAt.xlPart, _
        Excel.XlSearchOrder.xlByRows, Excel.XlSearchDirection.xlNext, False)

    While Not currentFind Is Nothing

        ' Keep track of the first range you find.
        If firstFind Is Nothing Then
            firstFind = currentFind

        ' If you didn't move to a new range, you are done.
        ElseIf currentFind.Address = firstFind.Address Then
            Exit While
        End If

        With currentFind.Font
            .Color = System.Drawing.ColorTranslator.ToOle(System.Drawing.Color.Red)
            .Bold = True
        End With

        currentFind = Me.Fruits.FindNext(currentFind)
    End While
End Sub

End Class


mexicano2013

  • Nuevo Miembro
  • *
  • Mensajes: 3
    • Ver Perfil
Re:ME MANDA ERROR EN FIND XLlookat
« Respuesta #2 en: Sábado 23 de Marzo de 2013, 00:26 »
0
ya agregue com pero me dice que no he declarado XLlookat
Auxilio.